示例#1
0
 /**
  * Generates a Response for all Exceptions without a specific override
  *
  * @return Response
  */
 public function get_response()
 {
     // Log the exception
     Kohana_Exception::log($this);
     $response = Response::factory();
     $view = Swiftriver::get_base_error_view();
     $view->content = View::factory('pages/errors/404')->set('page', $this->request()->uri());
     $response->body($view->render());
     return $response;
 }
示例#2
0
 /**
  * Exception handler, logs the exception and generates a 
  * Response object for display
  *
  * @param   Exception $e
  * @return  boolean
  */
 public static function _handler(Exception $e)
 {
     // Log the error
     Kohana::$log->add(Log::ERROR, $e->getMessage());
     // Generate the response
     $response = Response::factory();
     $view = Swiftriver::get_base_error_view();
     $view->content = View::factory('pages/errors/default');
     $response->body($view->render());
     return $response;
 }