[Feature] Init/ErrorHandler: Introduce ShouldNotAutoReport interface#11117
Open
mjansenDatabay wants to merge 1 commit intoILIAS-eLearning:trunkfrom
Open
[Feature] Init/ErrorHandler: Introduce ShouldNotAutoReport interface#11117mjansenDatabay wants to merge 1 commit intoILIAS-eLearning:trunkfrom
ShouldNotAutoReport interface#11117mjansenDatabay wants to merge 1 commit intoILIAS-eLearning:trunkfrom
Conversation
This PR introduces a marker interface for PHP exceptions to exclude certain exceptions from automatic error reporting mechanisms. Furthermore, it adds a dedicated README.md and ROADMAP.md for the `ErrorHandling` sub-component.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a way to mark exceptions so that they are not reported by ILIAS' global error handling, and adds documentation for the Error Handling roadmap.
Marker interface
ILIAS\Init\ErrorHandling\Exception\ShouldNotAutoReportincomponents/ILIAS/Init/src/ErrorHandling/Exception/ShouldNotAutoReport.php.error_log()when they are handled by Whoops' default and logging handlers.error.php); only the reporting step is skipped.ilErrorHandling
defaultHandler()(for production env.): if the exception implements the new interface, no log file is written, and the user sees a generic error message instead of a "logfile has been created" message.loggingHandler(): if the exception implements the marker interface, it returns without writing to the app log or system logger.Documentation
Init/src/ErrorHandling/: describes the new marker interface, when to use it, howilErrorHandlinguses it, and a short usage example.error.phpfrom the default exception handler and respond in-place with the error page (one response per error instead of redirect and second request, this is related to [Improvement] Init: Introduce ErrorResponder (first usage: handleilCtrlrouting errors as HTTP 404) #11110).Motivation