Created
February 16, 2010 02:05
-
-
Save weatheredwatcher/305213 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myErrorHandler($errno, $errstr, $errfile, $errline) | |
/** | |
* | |
* This is a collection of custom error handling procedures for the Leveraged Media System | |
* It is loaded in the main index file and overrides all error handling with the exception of fatal memory errors | |
*/ | |
{ | |
$myLog = new Log; | |
$myLog->set_page($_SERVER['PHP_SELF']); | |
switch ($errno) { | |
case E_USER_ERROR: | |
$myLog->set_log("ERROR:[$errno] Fatal error on line $errline "); | |
$myLog->write_log(); | |
exit(1); | |
break; | |
case E_USER_WARNING: | |
$myLog->set_log("WARNING:[$errno] $errstr "); | |
$myLog->write_log(); | |
break; | |
case E_USER_NOTICE: | |
$myLog->set_log("NOTICE:[$errno] $errstr "); | |
$myLog->write_log(); | |
break; | |
default: | |
$myLog->set_log("Unknown Error Type:[$errno] $errstr "); | |
$myLog->write_log(); | |
break; | |
} | |
/* Don't execute PHP internal error handler */ | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment