Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Improved error handlers

  • Loading branch information...
commit 5f53523b963a3c88b4fedf95609f70ca2ee9c499 1 parent 687448d
@archwisp authored
Showing with 15 additions and 4 deletions.
  1. +15 −4 Debug.php
View
19 Debug.php
@@ -41,7 +41,7 @@ public static function errorHandler($severity, $message, $filepath, $line)
{
new MindFrame2_Debug(new exception($output));
}
-
+
if (ini_get('log_errors') === '1')
{
error_log($output);
@@ -49,14 +49,25 @@ public static function errorHandler($severity, $message, $filepath, $line)
if (!in_array($severity, array(E_STRICT, E_NOTICE, E_USER_NOTICE)))
{
- exit($severity);
+ die('Unhandled error');
}
}
public static function exceptionHandler(Exception $exception)
{
- new MindFrame2_Debug($exception);
- exit;
+ if (ini_get('display_errors') === '1')
+ {
+ new MindFrame2_Debug($exception);
+ }
+
+ if (ini_get('log_errors') === '1')
+ {
+ error_log($exception->getMessage() .
+ "\nStack Trace:" .
+ "\n" . $exception->getTraceAsString());
+ }
+
+ die('Uncaught exception');
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.