Skip to content

Commit

Permalink
fix: convert php errors to exceptions when in debug mode (#4176)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvikan authored Jul 31, 2024
1 parent 1a8d0fb commit 9982bfc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
// 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),
Expand Down

0 comments on commit 9982bfc

Please sign in to comment.