Fixed exception handling

This commit is contained in:
Marcin Kurczewski 2014-05-20 22:26:18 +02:00
parent ef4ba5a348
commit 8e39f08cf5
2 changed files with 2 additions and 1 deletions

View file

@ -19,6 +19,7 @@ class ErrorController extends AbstractController
{ {
\Chibi\Util\Headers::setCode(400); \Chibi\Util\Headers::setCode(400);
Messenger::fail($exception->getMessage()); Messenger::fail($exception->getMessage());
$context = Core::getContext();
$context->transport->exception = $exception; $context->transport->exception = $exception;
$context->transport->queries = \Chibi\Database::getLogs(); $context->transport->queries = \Chibi\Database::getLogs();

View file

@ -35,7 +35,7 @@ class Dispatcher
$errorController = new ErrorController; $errorController = new ErrorController;
$errorController->simpleExceptionView($e); $errorController->simpleExceptionView($e);
} }
catch (SimpleException $e) catch (Exception $e)
{ {
$errorController = new ErrorController; $errorController = new ErrorController;
$errorController->seriousExceptionView($e); $errorController->seriousExceptionView($e);