drchanimal
2013-Jul-22 22:31 UTC
How to handle exception that is generated in rack middleware before it reach rails app?
I know that we can use config.exception_app to set up custom exception handling and also use rescue_from. However, I have an issue that there is malformed request (testing generated request) that caused Rails Rack middleware to throw an exception when Rack''s parse_query method. Here is the detail of the problem: http://stackoverflow.com/questions/17796878/how-to-handle-exception-generated-from-rack-before-reaching-your-rails-app The issue is that it failed in rails Rack::MethodOverride with is before ActionDispatch::ShowExceptions middleware and way before it even got to the rails app. So how do we handle the exception gracefully without showing the stack trace? Thanks for your help. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5cfd11d9-541b-4644-b469-8926a887076f%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Possibly Parallel Threads
- Rack middleware for shared connection pools?
- Rack Middleware or after filter
- Rack Middleware support for Rails 2.0.2? If not what is the alternative to implement similar functionality in Rails 2.0.2..
- rspec-rails and rack middleware
- Rack content-length Rack::Lint::LintErrors errors with unicorn