-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
This issue is automatically created based on existing pull request: #38873: Introduce ErrorHandlerException to be thrown by the ErrorHandler
Description (*)
Currently any warning being thrown gets transformed into an exception.
This makes it much more difficult to attempt to handle these errors as you can only catch ALL exceptions and rethrow if you don't detect it's been thrown by the ErrorHandler.php
This PR introduces the ErrorHandlerException based on the ErrorException so the Severity, Filename and Linenumber are natively supported. Which is only to be thrown by the ErrorHandler.php
This will make it so we no longer need to catch every exception, then read the string to determine the severity to handle these errors anymore.
And as a bonus, error reporting software can be much more precise in bundling and adding context to warnings.
Manual testing scenarios (*)
- Make sure a warning will get thrown by adding e.g.
compact('test')in thetemplates/html/header/logo.phtml - Make sure you see the ErrorHandlerException being thrown
Questions or comments
In theory customising the error message is no longer necessary. Do we remove these changes, or keep it for backward compatibility?
Contribution checklist (*)
- Pull request has a meaningful description of its purpose
- All commits are accompanied by meaningful commit messages
- All new or changed code is covered with unit/integration tests (if applicable)
- README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
- All automated tests passed successfully (all builds are green)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status