-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Description
When an exception occurs in dev environment, the exception is catched and converted to a response which provides our nice symfony exceptions.
However it is sent automatically by Symfony\Component\HttpKernel\HttpKernel::terminateWithException() which does:
$response = $this->handleException($exception, $request, self::MASTER_REQUEST);
$response->sendHeaders();
$response->sendContent();
What is the reason for breaking the Request->Response workflow for exceptions ? You could send the response and let the front controller call response->send() as usual.
I am integrating a symfony app with a reactphp event loop. With such setup, I cannot send exceptions response to the client, they are printed to the console sadly displaying the whole markup.
[edit] I tried to override the aforementioned method but since handleException is private, I cannot call it from my subclass.
My current option is to output to an error.html file and display it with my browser.