= Kohana::DEVELOPMENT) { // Show the normal Kohana error page. return parent::get_response(); } else { // Generate a nicer looking "Oops" page using error sub request $attributes = array( 'action' => $this->getCode(), 'message' => rawurlencode($this->getMessage()) ); $body = Request::factory(Route::get('error')->uri($attributes)) ->execute() ->body(); $response = Response::factory() ->status($this->getCode()) ->body($body); return $response; } } }