try { // Execute the main request $request->execute(); } catch (Exception $e) { // Be sure to log the error Kohana::$log->add(Kohana::ERROR, Kohana::exception_text($e));
// If there was an error, send a 404 response and display an error $request->status = 404; $request->response = View::factory('errors/404'); }
// Send the headers and echo the response $request->send_headers(); echo $request->response;
None worked. Am I supposed to add something else? (I've created proper controllers and view file).
Your error could be in the Request::instance() since it is not being included in the try block. You are also only catching instances of ReflectionException. If you want to catch all errors you should just catch(Exception $e). Also you need to be certain that the Request::factory('errors/404') does not throw any errors because if it does they won't be cautght.