mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-04 12:17:42 +02:00
@@ -118,20 +118,23 @@ class ErrorHandler
|
||||
return $backtrace;
|
||||
}
|
||||
|
||||
// Remove unnecessary info from backtrace
|
||||
|
||||
/**
|
||||
* Remove unnecessary info from backtrace
|
||||
*/
|
||||
if ($backtrace[0]['function'] == '{closure}') {
|
||||
unset($backtrace[0]);
|
||||
}
|
||||
|
||||
// Format backtrace
|
||||
|
||||
/**
|
||||
* Format backtrace
|
||||
*/
|
||||
$trace = array();
|
||||
|
||||
foreach ($backtrace as $entry) {
|
||||
|
||||
// Function
|
||||
|
||||
/**
|
||||
* Function
|
||||
*/
|
||||
$function = '';
|
||||
|
||||
if (isset($entry['class'])) {
|
||||
@@ -140,8 +143,9 @@ class ErrorHandler
|
||||
|
||||
$function .= $entry['function'] . '()';
|
||||
|
||||
// Arguments
|
||||
|
||||
/**
|
||||
* Arguments
|
||||
*/
|
||||
$arguments = array();
|
||||
|
||||
if (isset($entry['args']) && count($entry['args']) > 0) {
|
||||
@@ -158,8 +162,9 @@ class ErrorHandler
|
||||
}
|
||||
}
|
||||
|
||||
// Location
|
||||
|
||||
/**
|
||||
* Location
|
||||
*/
|
||||
$location = array();
|
||||
|
||||
if (isset($entry['file'])) {
|
||||
@@ -168,8 +173,9 @@ class ErrorHandler
|
||||
$location['code'] = static::highlightCode($entry['file'], $entry['line']);
|
||||
}
|
||||
|
||||
// Compile into array
|
||||
|
||||
/**
|
||||
* Compile into array
|
||||
*/
|
||||
$trace[] = array
|
||||
(
|
||||
'function' => $function,
|
||||
@@ -265,7 +271,7 @@ class ErrorHandler
|
||||
include 'Resources/Views/Errors/exception.php';
|
||||
} else {
|
||||
Response::status(500);
|
||||
include 'Resources/Views/Errors/error.php';
|
||||
include 'Resources/Views/Errors/production.php';
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
while(ob_get_level() > 0) ob_end_clean();
|
||||
|
@@ -4,29 +4,99 @@
|
||||
<meta charset="utf-8">
|
||||
<title>Error</title>
|
||||
<style type="text/css">
|
||||
* { margin: 0; padding: 0; }
|
||||
#gelato-error
|
||||
{
|
||||
#gelato-error {
|
||||
background:#eee;
|
||||
color:333;
|
||||
color:0;
|
||||
width:95%;
|
||||
margin:20px auto;
|
||||
font-size:14px;
|
||||
font-family:Verdana, Arial, Helvetica, "Nimbus Sans", FreeSans, Malayalam, sans-serif;
|
||||
margin:20px auto;
|
||||
}
|
||||
|
||||
#gelato-error pre {
|
||||
font-family:"Andale Mono", "Courier New", Courier;
|
||||
font-size:12px;
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
#gelato-error a {
|
||||
color:#cc0a0a;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
#gelato-error .error {
|
||||
background:#cc0a0a;
|
||||
color:#fff;
|
||||
font-size:24px;
|
||||
font-weight:700;
|
||||
padding:10px;
|
||||
}
|
||||
|
||||
#gelato-error .body {
|
||||
border:0 solid #ccc;
|
||||
padding:10px;
|
||||
}
|
||||
|
||||
#gelato-error .code {
|
||||
background:#fff;
|
||||
border:1px solid #ccc;
|
||||
overflow:auto;
|
||||
}
|
||||
|
||||
#gelato-error .heading {
|
||||
background:#444;
|
||||
color:#fff;
|
||||
font-size:18px;
|
||||
font-weight:700;
|
||||
padding:10px;
|
||||
}
|
||||
|
||||
#gelato-error .line {
|
||||
background:#777;
|
||||
color:#fff;
|
||||
padding-left:4px;
|
||||
padding-right:4px;
|
||||
}
|
||||
|
||||
#gelato-error .highlighted {
|
||||
background:#fceb71;
|
||||
border-top:1px solid #ccc;
|
||||
border-bottom:1px solid #ccc;
|
||||
}
|
||||
|
||||
#gelato-error .backtrace {
|
||||
background:#fff;
|
||||
margin-bottom:10px;
|
||||
border:1px solid #ccc;
|
||||
padding:10px;
|
||||
}
|
||||
|
||||
#gelato-error .backtrace ol {
|
||||
padding-left:40px;
|
||||
}
|
||||
|
||||
#gelato-error table {
|
||||
border-spacing:0;
|
||||
border-collapse:collapse;
|
||||
border-color:#ddd;
|
||||
border-style:solid;
|
||||
border-width:0 0 1px 1px;
|
||||
}
|
||||
|
||||
#gelato-error td {
|
||||
font-size:14px;
|
||||
background:#fff;
|
||||
border-color:#ddd;
|
||||
border-style:solid;
|
||||
border-width:1px 1px 0 0;
|
||||
margin:0;
|
||||
padding:4px;
|
||||
}
|
||||
|
||||
.pull-right {
|
||||
float:right;
|
||||
}
|
||||
#gelato-error pre {font-family:"Andale Mono", "Courier New", Courier;font-size:12px;margin:0px;padding:0px;}
|
||||
#gelato-error a {color:#cc0a0a;text-decoration:none;}
|
||||
#gelato-error .error {background:#cc0a0a;padding:10px;color:#fff;font-size:24px;font-weight:bold;}
|
||||
#gelato-error .body {border:0px solid #ccc;padding:10px;}
|
||||
#gelato-error .code {background:#fff;border:1px solid #ccc;overflow:auto;}
|
||||
#gelato-error .heading {background:#444;padding:10px;color:#fff;font-size:18px;font-weight:bold;}
|
||||
#gelato-error .line {background:#777;color:#fff;padding-left:4px;padding-right:4px;}
|
||||
#gelato-error .highlighted {background:#fceb71;border-top: 1px solid #ccc; border-bottom: 1px solid #ccc;}
|
||||
#gelato-error .backtrace {background:#fff;padding:10px;margin-bottom:10px;border:1px solid #ccc;}
|
||||
#gelato-error .backtrace ol {padding-left: 40px;}
|
||||
#gelato-error table {border-spacing:0;border-collapse: collapse;border-color: #ddd;border-width: 0 0 1px 1px;border-style: solid;}
|
||||
#gelato-error td {font-size:14px;background:#fff;border-color: #ddd;border-width: 1px 1px 0 0;border-style: solid;margin: 0;padding: 4px;}
|
||||
.pull-right {float: right;}
|
||||
</style>
|
||||
<body>
|
||||
<div id="gelato-error">
|
||||
@@ -201,9 +271,7 @@ Included Files <a href="#" onclick="return toggle('files', this);" style="float:
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div style="padding-top:20px;padding-bottom:20px; padding-left:10px;"><a href="http://gelato.monstra.org">Gelato Library</a></div>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
@@ -215,13 +283,11 @@ function toggle(id, link)
|
||||
if (link != null) {
|
||||
link.innerHTML = '-';
|
||||
}
|
||||
|
||||
div.style.display = "block";
|
||||
} else {
|
||||
if (link != null) {
|
||||
link.innerHTML = '+';
|
||||
}
|
||||
|
||||
div.style.display = "none";
|
||||
}
|
||||
|
||||
|
@@ -54,5 +54,4 @@ class Menu
|
||||
->display();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user