Skip to content

Commit

Permalink
Error API: catch all known error types
Browse files Browse the repository at this point in the history
Our error handler was not specifically dealing with some known error
types, resulting in a default "catch all" error message e.g. for
E_STRICT or E_RECOVERABLE_ERROR.

Now all constants defined in http://php.net/errorfunc.constants at the
time of this writing are handled, while retaining the default case for
future error types.

Fixes #19629
  • Loading branch information
dregad committed Apr 16, 2015
1 parent 119aca1 commit 7e3e893
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/error_api.php
Expand Up @@ -120,7 +120,15 @@ function error_handler( $p_type, $p_error, $p_file, $p_line, array $p_context )
case E_NOTICE:
$t_error_type = 'SYSTEM NOTICE';
break;
case E_STRICT:
$t_error_type = 'STRICT NOTICE';
break;
case E_RECOVERABLE_ERROR:
# This should generally be considered fatal (like E_ERROR)
$t_error_type = 'SYSTEM ERROR';
break;
case E_DEPRECATED:
case E_USER_DEPRECATED:
$t_error_type = 'DEPRECATED';
break;
case E_USER_ERROR:
Expand Down

0 comments on commit 7e3e893

Please sign in to comment.