We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da16691 commit fbf32f0Copy full SHA for fbf32f0
index.php
@@ -1,4 +1,5 @@
1
<?php
2
+
3
use Monster\App\Models\Env;
4
use Monster\App\Route;
5
@@ -70,10 +71,20 @@
70
71
// PHP error handling
72
$config = new Env('.env');
73
$debug = $config->get("APP_DEBUG");
74
75
if ($debug == "true") {
76
$whoops = new \Whoops\Run;
77
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
78
$whoops->register();
79
+} else {
80
+ set_error_handler(function () {
81
+ http_response_code(500);
82
+ include_once("routes/errors/500.php");
83
+ });
84
+ set_exception_handler(function () {
85
86
87
88
}
89
90
// Load application helpers
@@ -83,4 +94,4 @@
94
require 'routes/web.php';
95
96
// Run the application
-Route::run();
97
+Route::run();
0 commit comments