-
-
Notifications
You must be signed in to change notification settings - Fork 947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ticket/16958] Add exception handler for handling uncaught exceptions #6361
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -13,9 +13,12 @@ | |||
|
|||
namespace phpbb\debug; | |||
|
|||
use Symfony\Component\Debug\BufferingLogger; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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