diff --git a/PHPCI/Application.php b/PHPCI/Application.php index e4532d3b..011e27e5 100644 --- a/PHPCI/Application.php +++ b/PHPCI/Application.php @@ -73,11 +73,21 @@ class Application extends b8\Application { try { $this->response = parent::handleRequest(); + } catch (HttpException $ex) { + $this->config->set('page_title', 'Error'); + + $view = new View('exception'); + $view->exception = $ex; + + $this->response->setResponseCode($ex->getErrorCode()); + $this->response->setContent($view->render()); } catch (\Exception $ex) { $this->config->set('page_title', 'Error'); $view = new View('exception'); $view->exception = $ex; + + $this->response->setResponseCode(500); $this->response->setContent($view->render()); }