set global errorToExceptionHandler
This commit is contained in:
parent
fd0f634621
commit
4138bab0e8
@ -6,6 +6,8 @@ if (defined('S9Y_FRAMEWORK')) {
|
||||
return;
|
||||
}
|
||||
|
||||
set_error_handler('errorToExceptionHandler', E_ALL & ~E_NOTICE);
|
||||
|
||||
@define('S9Y_FRAMEWORK', true);
|
||||
|
||||
if (!headers_sent()) {
|
||||
@ -60,6 +62,22 @@ if ($serendipity['production'] !== true) {
|
||||
@ini_set('display_errors', 'on');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set our own exeption handler tp convert all errors into exeptions automatically
|
||||
*
|
||||
* @access public
|
||||
* @param unchanged default
|
||||
* @return null
|
||||
*/
|
||||
function errorToExceptionHandler($errNo, $errStr, $errFile, $errLine, $errContext) {
|
||||
global $php_errormsg; $php_errormsg = $errStr;
|
||||
if (error_reporting() == 0) return;
|
||||
if($serendipity['production'] !== true) echo ' == DEBUG MODE == ';
|
||||
echo '<pre>';
|
||||
throw new ErrorException($errStr, 0, $errNo, $errFile, $errLine);
|
||||
echo '</pre>';
|
||||
}
|
||||
|
||||
// Default rewrite method
|
||||
$serendipity['rewrite'] = 'none';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user