Skip to content
Browse files

Include backtrace in failsafe log. Rescue possible exceptions in fail…

…safe response.
  • Loading branch information...
1 parent 55a5c70 commit bd9805871b576984e13c3d99558eda27d22c06c5 @jeremy jeremy committed
View
2 actionpack/lib/action_dispatch/middleware/show_exceptions.rb
@@ -72,7 +72,7 @@ def render_exception(env, exception)
rescue_action_in_public(exception)
end
rescue Exception => failsafe_error
- $stderr.puts "Error during failsafe response: #{failsafe_error}"
+ $stderr.puts "Error during failsafe response: #{failsafe_error}\n #{failsafe_error.backtrace * "\n "}"
FAILSAFE_RESPONSE
end
View
2 actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb
@@ -13,7 +13,7 @@
request_dump = clean_params.empty? ? 'None' : clean_params.inspect.gsub(',', ",\n")
def debug_hash(hash)
- hash.sort_by { |k, v| k.to_s }.map { |k, v| "#{k}: #{v.inspect}" }.join("\n")
+ hash.sort_by { |k, v| k.to_s }.map { |k, v| "#{k}: #{v.inspect rescue $!.message}" }.join("\n")
end
%>

1 comment on commit bd98058

@snusnu

Thank you!

Please sign in to comment.
Something went wrong with that request. Please try again.