Skip to content

Include E_NOTICE and E_WARNING in default report-only error levels#65

Merged
tommitchelmore merged 1 commit intomasterfrom
fix/error-reporting-levels
Mar 24, 2026
Merged

Include E_NOTICE and E_WARNING in default report-only error levels#65
tommitchelmore merged 1 commit intomasterfrom
fix/error-reporting-levels

Conversation

@tommitchelmore
Copy link
Copy Markdown
Collaborator

The default error handler policy converts E_NOTICE and E_WARNING into ErrorException instances. This "fatalises" non-blocking PHP issues, causing script termination for recoverable events (e.g., undefined array keys). In a WordPress environment, this strictness leads to unnecessary crashes for minor issues that do not inherently prevent a successful response.

Solution: added E_NOTICE and E_WARNING to the default $errorsToReportOnly array in RegisterExceptionHandler::handleError. These levels will now be reported to the configured logger but will no longer throw an exception that halts execution.

@tommitchelmore tommitchelmore force-pushed the fix/error-reporting-levels branch from 921220e to d618180 Compare March 24, 2026 13:57
@tommitchelmore tommitchelmore self-assigned this Mar 24, 2026
@tommitchelmore tommitchelmore merged commit 210186d into master Mar 24, 2026
12 checks passed
@tommitchelmore tommitchelmore deleted the fix/error-reporting-levels branch March 24, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants