From be80b756928e14dd242465110970185fb717ba92 Mon Sep 17 00:00:00 2001 From: Michel Date: Thu, 7 Nov 2024 22:15:30 +0100 Subject: [PATCH] Adds when error gets called --- src/php/CrashHandler.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/php/CrashHandler.php b/src/php/CrashHandler.php index 527acaa..e195f64 100644 --- a/src/php/CrashHandler.php +++ b/src/php/CrashHandler.php @@ -37,6 +37,11 @@ final class CrashHandler return new CallbackHandler( function (Throwable $exception, InspectorInterface $inspector, RunInterface $run) { + ContainerHandler::get(Logger::class) + ->emergency( + "Unexpected exception occurred: {$exception->getMessage()} at line {$exception->getLine()} in {$exception->getFile()}", + ); + http_response_code(500); echo ContainerHandler::get(TemplateEngine::class) ->renderErrorPage(500);