[Feature] Init/ErrorHandler: Introduce ShouldNotAutoReport interface#11117
[Feature] Init/ErrorHandler: Introduce ShouldNotAutoReport interface#11117mjansenDatabay wants to merge 1 commit intoILIAS-eLearning:trunkfrom
ShouldNotAutoReport interface#11117Conversation
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.
|
Dear colleagues (not only the assigned co-authorities, but any developer interested in this topic), do you have and thoughts about this? Objections? Approvals/Likes? Best regards, |
|
Thank you very much for this proposal! I think, I understand the motivation for this. I'm skeptical about the approach, though:
If we think we need this: Shouldn't this rather be linked to the logging levels? Personally, I would suggest that, if really needed, the list is probably a well defined one, that we as a community can agree upon and that should be kept centrally. If we decide that we would like to have this available for custom components (I'm rather unsure we do), we should have a process to agree if an So far my five cents. Thanks again and best, |
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