@@ -14,14 +14,8 @@ module ActionDispatch
14
14
# If the application returns a "X-Cascade" pass response, this middleware
15
15
# will send an empty response as result with the correct status code.
16
16
# If any exception happens inside the exceptions app, this middleware
17
- # catches the exceptions and returns a FAILSAFE_RESPONSE .
17
+ # catches the exceptions and returns a failsafe response .
18
18
class ShowExceptions
19
- FAILSAFE_RESPONSE = [ 500 , { "Content-Type" => "text/plain" } ,
20
- [ "500 Internal Server Error\n " \
21
- "If you are the administrator of this website, then please read this web " \
22
- "application's log file and/or the web server's log file to find out what " \
23
- "went wrong." ] ]
24
-
25
19
def initialize ( app , exceptions_app )
26
20
@app = app
27
21
@exceptions_app = exceptions_app
@@ -52,7 +46,12 @@ def render_exception(request, exception)
52
46
response [ 1 ] [ "X-Cascade" ] == "pass" ? pass_response ( status ) : response
53
47
rescue Exception => failsafe_error
54
48
$stderr. puts "Error during failsafe response: #{ failsafe_error } \n #{ failsafe_error . backtrace * "\n " } "
55
- FAILSAFE_RESPONSE
49
+
50
+ [ 500 , { "Content-Type" => "text/plain" } ,
51
+ [ "500 Internal Server Error\n " \
52
+ "If you are the administrator of this website, then please read this web " \
53
+ "application's log file and/or the web server's log file to find out what " \
54
+ "went wrong." ] ]
56
55
end
57
56
58
57
def pass_response ( status )
0 commit comments