@@ 53-69 (lines=17) @@ | ||
50 | $response->send(); |
|
51 | }); |
|
52 | ||
53 | \erdiko\core\ToroHook::add("500", function ($vars = array()) { |
|
54 | // Toro::serve Legacy |
|
55 | $vars['debug'] = \erdiko\core\ErrorHandler::isDebug(); |
|
56 | $vars['code'] = 500; |
|
57 | $vars['message'] = "Sorry, something went wrong."; |
|
58 | Erdiko::log(\Psr\Log\LogLevel::ERROR, "{$vars['code']}: {$vars['path_info']} {$vars['error']}"); |
|
59 | ||
60 | $theme = new \erdiko\core\Theme( 'bootstrap' ); |
|
61 | $theme->addCss( 'font-awesome', |
|
62 | '//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css' ); |
|
63 | $theme->addCss( 'font-awesome-animation', |
|
64 | '/themes/bootstrap/css/font-awesome-animation.css' ); |
|
65 | ||
66 | $response = new \erdiko\core\Response( $theme ); |
|
67 | $response->setContent( \Erdiko::getView('error', $vars) ); |
|
68 | $response->send(); |
|
69 | }); |
|
70 | ||
71 | // Error management & beautify output. |
|
72 | \erdiko\core\ToroHook::add("general_error", function ($vars = array()) { |
|
@@ 72-88 (lines=17) @@ | ||
69 | }); |
|
70 | ||
71 | // Error management & beautify output. |
|
72 | \erdiko\core\ToroHook::add("general_error", function ($vars = array()) { |
|
73 | $vars['debug'] = \erdiko\core\ErrorHandler::isDebug(); |
|
74 | if(!isset($vars['path_info'])){ |
|
75 | $vars['path_info'] = $_SERVER['REQUEST_URI']; |
|
76 | } |
|
77 | Erdiko::log(\Psr\Log\LogLevel::ERROR, "{$vars['code']}: {$vars['path_info']} {$vars['error']}"); |
|
78 | ||
79 | $theme = new \erdiko\core\Theme('bootstrap'); |
|
80 | $theme->addCss('font-awesome', |
|
81 | '//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css'); |
|
82 | $theme->addCss('font-awesome-animation', |
|
83 | '/themes/bootstrap/css/font-awesome-animation.css'); |
|
84 | ||
85 | $response = new \erdiko\core\Response($theme); |
|
86 | $response->setContent(\Erdiko::getView('error', $vars)); |
|
87 | $response->send(); |
|
88 | }); |