Created
November 25, 2010 22:40
-
-
Save wimleers/716034 to your computer and use it in GitHub Desktop.
Set this error handler before erroneous code and you'll get a nice report of the exact error, including a brief stack trace. Simple & nice. Who knew. Stupid PHP.
This file contains 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 handler($errno, $errstr, $errfile, $errline) { | |
throw new Exception($errstr, $errno); | |
} | |
set_error_handler('handler'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment