mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-10 15:14:30 +02:00
Update Gelato to 1.0.1
This commit is contained in:
@@ -18,6 +18,25 @@
|
||||
class ErrorHandler
|
||||
{
|
||||
|
||||
/**
|
||||
* Error Levels
|
||||
*/
|
||||
public static $levels = array (
|
||||
E_ERROR => 'Fatal Error',
|
||||
E_PARSE => 'Parse Error',
|
||||
E_COMPILE_ERROR => 'Compile Error',
|
||||
E_COMPILE_WARNING => 'Compile Warning',
|
||||
E_STRICT => 'Strict Mode Error',
|
||||
E_NOTICE => 'Notice',
|
||||
E_WARNING => 'Warning',
|
||||
E_RECOVERABLE_ERROR => 'Recoverable Error',
|
||||
E_USER_NOTICE => 'Notice',
|
||||
E_USER_WARNING => 'Warning',
|
||||
E_USER_ERROR => 'Error',
|
||||
/*E_DEPRECATED => 'Deprecated',*/ /* PHP 5.3 only */
|
||||
/*E_USER_DEPRECATED => 'Deprecated'*/ /* PHP 5.3 only */
|
||||
);
|
||||
|
||||
/**
|
||||
* Protected constructor since this is a static class.
|
||||
*
|
||||
@@ -194,7 +213,7 @@ class ErrorHandler
|
||||
if (isset($entry['file'])) {
|
||||
$location['file'] = $entry['file'];
|
||||
$location['line'] = $entry['line'];
|
||||
$location['code'] = static::highlightCode($entry['file'], $entry['line']);
|
||||
$location['code'] = self::highlightCode($entry['file'], $entry['line']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -247,24 +266,7 @@ class ErrorHandler
|
||||
// Determine error type
|
||||
if ($exception instanceof ErrorException) {
|
||||
$error['type'] = 'ErrorException: ';
|
||||
|
||||
$codes = array (
|
||||
E_ERROR => 'Fatal Error',
|
||||
E_PARSE => 'Parse Error',
|
||||
E_COMPILE_ERROR => 'Compile Error',
|
||||
E_COMPILE_WARNING => 'Compile Warning',
|
||||
E_STRICT => 'Strict Mode Error',
|
||||
E_NOTICE => 'Notice',
|
||||
E_WARNING => 'Warning',
|
||||
E_RECOVERABLE_ERROR => 'Recoverable Error',
|
||||
/*E_DEPRECATED => 'Deprecated',*/
|
||||
E_USER_NOTICE => 'Notice',
|
||||
E_USER_WARNING => 'Warning',
|
||||
E_USER_ERROR => 'Error',
|
||||
/*E_USER_DEPRECATED => 'Deprecated'*/
|
||||
);
|
||||
|
||||
$error['type'] .= in_array($error['code'], array_keys($codes)) ? $codes[$error['code']] : 'Unknown Error';
|
||||
$error['type'] .= in_array($error['code'], array_keys(ErrorHandler::$levels)) ? ErrorHandler::$levels[$error['code']] : 'Unknown Error';
|
||||
} else {
|
||||
$error['type'] = get_class($exception);
|
||||
}
|
||||
@@ -283,8 +285,8 @@ class ErrorHandler
|
||||
$error['backtrace'] = array_slice($error['backtrace'], 1); //Remove call to error handler from backtrace
|
||||
}
|
||||
|
||||
$error['backtrace'] = static::formatBacktrace($error['backtrace']);
|
||||
$error['highlighted'] = static::highlightCode($error['file'], $error['line']);
|
||||
$error['backtrace'] = self::formatBacktrace($error['backtrace']);
|
||||
$error['highlighted'] = self::highlightCode($error['file'], $error['line']);
|
||||
|
||||
Response::status(500);
|
||||
include 'Resources/Views/Errors/exception.php';
|
||||
|
@@ -11,6 +11,16 @@
|
||||
font-size:14px;
|
||||
font-family:Verdana, Arial, Helvetica, "Nimbus Sans", FreeSans, Malayalam, sans-serif;
|
||||
margin:20px auto;
|
||||
|
||||
-webkit-box-shadow: 1px 1px 18px rgba(50, 50, 50, 0.75);
|
||||
-moz-box-shadow: 1px 1px 18px rgba(50, 50, 50, 0.75);
|
||||
box-shadow: 1px 1px 18px rgba(50, 50, 50, 0.75);
|
||||
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
|
||||
|
||||
}
|
||||
|
||||
#gelato-error pre {
|
||||
@@ -31,6 +41,13 @@
|
||||
font-size:24px;
|
||||
font-weight:700;
|
||||
padding:10px;
|
||||
|
||||
-moz-border-radius-topleft: 5px;
|
||||
-webkit-border-top-left-radius: 5px;
|
||||
border-top-left-radius: 5px;
|
||||
-moz-border-radius-topright: 5px;
|
||||
-webkit-border-top-right-radius: 5px;
|
||||
border-top-right-radius: 5px;
|
||||
}
|
||||
|
||||
#gelato-error .body {
|
||||
|
Reference in New Issue
Block a user