Skip to content

Comments

[Feature] Init/ErrorHandler: Introduce ShouldNotAutoReport interface#11117

Open
mjansenDatabay wants to merge 1 commit intoILIAS-eLearning:trunkfrom
mjansenDatabay:improvement/12/should-not-auto-report-exc
Open

[Feature] Init/ErrorHandler: Introduce ShouldNotAutoReport interface#11117
mjansenDatabay wants to merge 1 commit intoILIAS-eLearning:trunkfrom
mjansenDatabay:improvement/12/should-not-auto-report-exc

Conversation

@mjansenDatabay
Copy link
Contributor

@mjansenDatabay mjansenDatabay commented Feb 13, 2026

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

  • New interface: ILIAS\Init\ErrorHandling\Exception\ShouldNotAutoReport in components/ILIAS/Init/src/ErrorHandling/Exception/ShouldNotAutoReport.php.
  • Exceptions implementing this interface are not reported: no log file is written, and nothing is written to the application log or PHP's error_log() when they are handled by Whoops' default and logging handlers.
  • The user still sees an error page (by being redirected to error.php); only the reporting step is skipped.
  • Use this for expected or high-volume exceptions (e.g. routing/dispatching failures, invalid request parameters) to avoid log noise and unnecessary I/O.

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

Motivation

  • Lets components opt out of reporting for specific exception types without touching global handler configuration.
  • Reduces I/O and log volume for expected or client-side failures (e.g. bots, broken links).

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.
@mjansenDatabay mjansenDatabay self-assigned this Feb 13, 2026
@mjansenDatabay mjansenDatabay added improvement roadmap php Pull requests that update Php code documentation Pull requests that only update or add documentation. labels Feb 13, 2026
@mjansenDatabay
Copy link
Contributor Author

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,
Michael

@kergomard
Copy link
Contributor

kergomard commented Feb 20, 2026

Hi @mjansenDatabay

Thank you very much for this proposal!

I think, I understand the motivation for this. I'm skeptical about the approach, though:

  1. As always, I do think this should not be left to developers to decide.
  2. Is it even right that these cases trigger an Exception shouldn't we rather try to catch the problem and show a proper message before it does that? This rather feels like treating symptoms.
  3. I think we should keep things consistent, without having to look around for the implementation of an interface.

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 Exception in the ILIAS namespace falls into this category or not.

So far my five cents.

Thanks again and best,
@kergomard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Pull requests that only update or add documentation. improvement php Pull requests that update Php code roadmap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants