summaryrefslogtreecommitdiff
path: root/lib/util.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-06-28 19:24:14 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-06-28 19:24:14 -0400
commit14575fe6fc0de65f0234c73147ca877cc4c46cb8 (patch)
tree00bffa1b121ab2414b59daee564b3ea687c7a2c1 /lib/util.php
parent6557a569e595eee75609eb6cf12e6e788061daa9 (diff)
better output for common error handler
Diffstat (limited to 'lib/util.php')
-rw-r--r--lib/util.php25
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/util.php b/lib/util.php
index 1ae43a056..f9ff38c8a 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -1348,18 +1348,39 @@ function common_canonical_sms($sms)
function common_error_handler($errno, $errstr, $errfile, $errline, $errcontext)
{
switch ($errno) {
+
+ case E_ERROR:
+ case E_COMPILE_ERROR:
+ case E_CORE_ERROR:
case E_USER_ERROR:
- common_log(LOG_ERR, "[$errno] $errstr ($errfile:$errline)");
- exit(1);
+ case E_PARSE:
+ case E_RECOVERABLE_ERROR:
+ common_log(LOG_ERR, "[$errno] $errstr ($errfile:$errline) [ABORT]");
+ die();
break;
+ case E_WARNING:
+ case E_COMPILE_WARNING:
+ case E_CORE_WARNING:
case E_USER_WARNING:
common_log(LOG_WARNING, "[$errno] $errstr ($errfile:$errline)");
break;
+ case E_NOTICE:
case E_USER_NOTICE:
common_log(LOG_NOTICE, "[$errno] $errstr ($errfile:$errline)");
break;
+
+ case E_STRICT:
+ case E_DEPRECATED:
+ case E_USER_DEPRECATED:
+ // XXX: config variable to log this stuff, too
+ break;
+
+ default:
+ common_log(LOG_ERR, "[$errno] $errstr ($errfile:$errline) [UNKNOWN LEVEL, die()'ing]");
+ die();
+ break;
}
// FIXME: show error page if we're on the Web