[ticket/16958] Add exception handler for handling uncaught exceptions#6361
[ticket/16958] Add exception handler for handling uncaught exceptions#6361marc1706 wants to merge 10 commits intophpbb:masterfrom
Conversation
|
I've marked this as WIP for now as I still want to test the behavior on other pages. |
Also with debug enabled? |
In ajax requests I have opted to not add a backtrace. |
There was a problem hiding this comment.
It's looking good, but I've some testing results:
- SQL errors are HTML escaped twice in the gray box:
-
When using an incorrect database password I get a white page instead of an error message in this styling.
-
If a PHP error occurs during an AJAX request (for example a variable doesn't exist on an object) the error is hidden with a "something went wrong" in the AJAX pop-up. But you can no longer see the actual error message if you open up the network tab to see the AJAX response. The original error should also be returned from this endpoint and ideally be shown in the pop-up as well.
Original behaviour: (able to find the actual error message)
|
The exceptions that are thrown from phpbb (runtime_exception for example), are multilanguage, since the message is a language variable and they have an additional constructor parameter for the language parameters. Maybe you could try translating them if the exception is an instance of runtime_exception or implements exception_interface. One more thing, as I report here https://tracker.phpbb.com/browse/PHPBB3-16198 the component we are using to handle errors is discontinued, I don't know if it is worth developing on top of it, or better update it first |
PHPBB3-16958
Also removed all HTML output from PHP files of exception handler. PHPBB3-16958
phpBB/phpbb/debug/debug.php
Outdated
|
|
||
| namespace phpbb\debug; | ||
|
|
||
| use Symfony\Component\Debug\BufferingLogger; |
There was a problem hiding this comment.
Then you can remove symfony/debug in composer.json
You should replace symfony/debug by symfony/error-component in composer.json
|
Update |




This should improve the user experience a bit when it comes to exceptions being thrown while using phpBB. In addition to certainly having a nicer touch to them visually, they should prevent users of phpBB from ending up at a white page (error 500 style white page).
Checklist:
ToDo:
Check potential use in installerScreenshots:
Tracker ticket (set the ticket ID to your ticket ID):
https://tracker.phpbb.com/browse/PHPBB3-16958