fix: convert php errors to exceptions when in debug mode (#4176)

This commit is contained in:
Dag 2024-07-31 17:51:44 +02:00 committed by GitHub
parent 1a8d0fb8ab
commit 9982bfce1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,8 +25,10 @@ set_error_handler(function ($code, $message, $file, $line) {
// Deprecation messages and other masked errors are typically ignored here
return false;
}
// In the future, uncomment this:
//throw new \ErrorException($message, 0, $code, $file, $line);
if (Debug::isEnabled()) {
// This might be annoying, but it's for the greater good
throw new \ErrorException($message, 0, $code, $file, $line);
}
$text = sprintf(
'%s at %s line %s',
sanitize_root($message),