feat(exception): Register global exception handler

This handler catches uncaught exceptions and prints their message
and stack trace.
This commit is contained in:
2026-03-16 06:38:26 -03:00
parent b6baeef32f
commit 53e862d126

View File

@@ -12,3 +12,8 @@ spl_autoload_register(function ($className) {
require_once $file;
}
});
set_exception_handler(function ($exception) {
echo "Uncaught exception: " , $exception->getMessage(), "\n";
echo $exception->getTraceAsString();
});