Created
April 26, 2016 19:37
-
-
Save alexweissman/bf9931dcd1ee7341eec7e683ec834dff 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
| public function fatalHandler() { | |
| $error = error_get_last(); | |
| // Handle fatal errors | |
| if( $error !== NULL && $error['type'] == E_ERROR) { | |
| $errno = $error["type"]; | |
| $errfile = $error["file"]; | |
| $errline = $error["line"]; | |
| $errstr = $error["message"]; | |
| // Inform the client of a fatal error | |
| if ($this->alerts && is_object($this->alerts) && $this->translator) | |
| $this->alerts->addMessageTranslated("danger", "SERVER_ERROR"); | |
| error_log("Fatal error ($errno) in $errfile on line $errline: $errstr"); | |
| header("HTTP/1.1 500 Internal Server Error"); | |
| exit(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment