Commit 109a7b4b authored by Taylor Otwell's avatar Taylor Otwell

Refactoring Error class.

parent ce20d7b9
...@@ -45,7 +45,7 @@ class Error { ...@@ -45,7 +45,7 @@ class Error {
call_user_func(Config::get('error.logger'), $severity, $message.' in '.$e->getFile().' on line '.$e->getLine()); call_user_func(Config::get('error.logger'), $severity, $message.' in '.$e->getFile().' on line '.$e->getLine());
} }
static::show($e, $severity, $message, $e->getFile()); static::show($e, $severity, $message);
exit(1); exit(1);
} }
...@@ -56,20 +56,19 @@ class Error { ...@@ -56,20 +56,19 @@ class Error {
* @param Exception $e * @param Exception $e
* @param string $severity * @param string $severity
* @param string $message * @param string $message
* @param string $file
* @return void * @return void
*/ */
private static function show($e, $severity, $message, $file) private static function show($e, $severity, $message)
{ {
if (Config::get('error.detail')) if (Config::get('error.detail'))
{ {
$view = View::make('exception') $view = View::make('exception')
->bind('severity', $severity) ->bind('severity', $severity)
->bind('message', $message) ->bind('message', $message)
->bind('file', $file) ->bind('file', $e->getFile())
->bind('line', $e->getLine()) ->bind('line', $e->getLine())
->bind('trace', $e->getTraceAsString()) ->bind('trace', $e->getTraceAsString())
->bind('contexts', static::context($file, $e->getLine())); ->bind('contexts', static::context($e->getFile(), $e->getLine()));
Response::make($view, 500)->send(); Response::make($view, 500)->send();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment