diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index f3b3f8a..2d908e7 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -13,6 +13,8 @@ class HomeController extends Controller { public function test() { + a; + return view('index', ['test' => 'Dit is een test']); } diff --git a/src/Runtime/Exceptions/ExceptionHandler.php b/src/Runtime/Exceptions/ExceptionHandler.php index f3d8f07..8b03c75 100644 --- a/src/Runtime/Exceptions/ExceptionHandler.php +++ b/src/Runtime/Exceptions/ExceptionHandler.php @@ -2,6 +2,7 @@ namespace Runtime\Exceptions; +use Whoops\Handler\Handler; use Whoops\Handler\JsonResponseHandler; use Whoops\Handler\PlainTextHandler; use Whoops\Run; @@ -38,7 +39,19 @@ class ExceptionHandler { public static function register() { self::$handler = new Run(); - self::$handler->pushHandler(new PrettyPageHandler()); + + $debug = false; //TODO: Get from config + + if($debug === false) { + self::$handler->pushHandler(function(\Exception $exception, $inspector, $run) { + echo 'An error has occured'; + //TODO: Add proper 500 error page + return Handler::DONE; + }); + } + else { + self::$handler->pushHandler(new PrettyPageHandler()); + } if (Misc::isAjaxRequest()){ self::$handler->pushHandler(new JsonResponseHandler());