Skip to content

Instantly share code, notes, and snippets.

@huoxito
Created August 12, 2016 18:22
Show Gist options
  • Save huoxito/dad26bab59ada50d39322b8128d49438 to your computer and use it in GitHub Desktop.
Save huoxito/dad26bab59ada50d39322b8128d49438 to your computer and use it in GitHub Desktop.
diff --git a/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb b/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb
index c1562fc..f036359 100644
--- a/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb
+++ b/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb
@@ -81,12 +81,16 @@ module ActionDispatch
return unless logger
exception = wrapper.exception
+ klass_name = wrapper.exception.class.name
+ return if ActionDispatch::ExceptionWrapper.rescue_responses[klass_name] == :not_found
trace = wrapper.application_trace
trace = wrapper.framework_trace if trace.empty?
+ request = Request.new(env)
ActiveSupport::Deprecation.silence do
- message = "\n#{exception.class} (#{exception.message}):\n"
+ message = "\n#{request.url}"
+ message << "\n#{exception.class} (#{exception.message}):\n"
message << exception.annoted_source_code.to_s if exception.respond_to?(:annoted_source_code)
message << " " << trace.join("\n ")
logger.fatal("#{message}\n\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment