8
0
Fork 0

throw error exceptions on error levels only

Dieser Commit ist enthalten in:
Daniel Seifert 2022-08-15 23:40:50 +02:00
Ursprung ff606efef3
Commit 236680ad7a
Signiert von: DanielS
GPG-Schlüssel-ID: 6A513E13AEE66170
1 geänderte Dateien mit 14 neuen und 11 gelöschten Zeilen

Datei anzeigen

@ -43,10 +43,11 @@ class ShopControl_DebugBar extends ShopControl_DebugBar_parent
public function d3DebugBarSetErrorHandler()
{
if ($this->d3CanActivateDebugBar()) {
set_error_handler( function( $severity, $message, $file, $line ) {
if ( ! ( error_reporting() & $severity ) ) {
set_error_handler(
function( $severity, $message, $file, $line ) {
if ( 0 === error_reporting() || !( error_reporting() & $severity ) ) {
// This error code is not included in error_reporting.
return;
return false;
}
$smartyTemplate = $this->getSmartyTemplateLocationFromError( $message );
@ -55,7 +56,9 @@ class ShopControl_DebugBar extends ShopControl_DebugBar_parent
}
throw new ErrorException( $message, 0, $severity, $file, $line );
} );
},
E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR
);
}
}