File tree 1 file changed +15
-8
lines changed 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -30,20 +30,23 @@ public static function exception($exception, $trace = true)
30
30
// If detailed errors are enabled, we'll just format the exception into
31
31
// a simple error message and display it on the screen. We don't use a
32
32
// View in case the problem is in the View class.
33
+
33
34
if (Config::get ('error.detail ' ))
34
35
{
35
- echo "<html><h2>Unhandled Exception</h2>
36
- <h3>Message:</h3>
37
- <pre> " .$ message ."</pre>
38
- <h3>Location:</h3>
39
- <pre> " .$ file ." on line " .$ exception ->getLine ()."</pre> " ;
36
+ $ response_body = "<html><h2>Unhandled Exception</h2>
37
+ <h3>Message:</h3>
38
+ <pre> " .$ message ."</pre>
39
+ <h3>Location:</h3>
40
+ <pre> " .$ file ." on line " .$ exception ->getLine ()."</pre> " ;
40
41
41
42
if ($ trace )
42
43
{
43
- echo "
44
+ $ response_body .= "
44
45
<h3>Stack Trace:</h3>
45
46
<pre> " .$ exception ->getTraceAsString ()."</pre></html> " ;
46
47
}
48
+
49
+ $ response = Response::make ($ response_body , 500 );
47
50
}
48
51
49
52
// If we're not using detailed error messages, we'll use the event
@@ -53,9 +56,13 @@ public static function exception($exception, $trace = true)
53
56
{
54
57
$ response = Event::first ('500 ' );
55
58
56
- echo Response::prepare ($ response)-> render ( );
59
+ $ response = Response::prepare ($ response );
57
60
}
58
61
62
+ $ response ->render ();
63
+ $ response ->send ();
64
+ $ response ->foundation ->finish ();
65
+
59
66
exit (1 );
60
67
}
61
68
@@ -119,4 +126,4 @@ public static function log($exception)
119
126
}
120
127
}
121
128
122
- }
129
+ }
You can’t perform that action at this time.
0 commit comments