How to handle exception that is generated in rack middleware before it reach rails app?

21 views
Skip to first unread message

drchanimal

unread,
Jul 22, 2013, 6:31:47 PM7/22/13
to rubyonra...@googlegroups.com
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.
Reply all
Reply to author
Forward
0 new messages