- // This handler is for logging only. Return false will instruct PHP
- // to continue regular handling.
- return false;
+ // If $wgPropagateErrors is true return false so PHP shows/logs the error normally.
+ // Ignore $wgPropagateErrors if the error should break execution, or track_errors is set
+ // (which means someone is counting on regular PHP error handling behavior).
+ return !( $wgPropagateErrors || $level == E_RECOVERABLE_ERROR || ini_get( 'track_errors' ) );