showErrorPage(); } else { $this->showErrorJson(); } } private function showErrorJson() { $exception['errno'] = $this->code; $exception['msg'] = $this->message; @header('Content-type: application/json; charset=utf-8'); exit(json_encode($exception)); } private function showErrorPage() { echo \View::make('errors.e')->with('code', $this->code) ->with('message', $this->message) ->render(); exit; } }