Skip to content

[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
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.

1 participant