feat(exception): Register global exception handler
This handler catches uncaught exceptions and prints their message and stack trace.
This commit is contained in:
@@ -12,3 +12,8 @@ spl_autoload_register(function ($className) {
|
|||||||
require_once $file;
|
require_once $file;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
set_exception_handler(function ($exception) {
|
||||||
|
echo "Uncaught exception: " , $exception->getMessage(), "\n";
|
||||||
|
echo $exception->getTraceAsString();
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user