summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-08-30 01:30:52 -0400
committerEvan Prodromou <evan@prodromou.name>2008-08-30 01:30:52 -0400
commit439c14d98628fd3c7ff774e6f8334bb71663efea (patch)
treef2a63bff9956bc52ef046d1a5d09db89a6dd0330 /lib
parenta586bbed243079cd2afb7760e2fc97d731bdcb51 (diff)
use common log in error handler rather than echo
darcs-hash:20080830053052-84dde-279d1c52e9b8696079ba686009ce2d71725a690e.gz
Diffstat (limited to 'lib')
-rw-r--r--lib/util.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/util.php b/lib/util.php
index c6cdfbcb9..4af0e6fcd 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -1490,22 +1490,20 @@ function common_canonical_sms($sms) {
function common_error_handler($errno, $errstr, $errfile, $errline, $errcontext) {
switch ($errno) {
case E_USER_ERROR:
- echo "ERROR: [$errno] $errstr ($errfile:$errline)\n";
- echo " Fatal error on line $errline in file $errfile";
- echo ", PHP " . PHP_VERSION . " (" . PHP_OS . ")\n";
- echo "Aborting...\n";
+ common_log(LOG_ERR, "[$errno] $errstr ($errfile:$errline)");
exit(1);
break;
case E_USER_WARNING:
- echo "WARNING [$errno] $errstr ($errfile:$errline)\n";
+ common_log(LOG_WARNING, "[$errno] $errstr ($errfile:$errline)");
break;
case E_USER_NOTICE:
- echo "NOTICE [$errno] $errstr ($errfile:$errline)\n";
+ common_log(LOG_NOTICE, "[$errno] $errstr ($errfile:$errline)");
break;
}
+ # FIXME: show error page if we're on the Web
/* Don't execute PHP internal error handler */
return true;
}