vidibus/vidibus-routing_error — pull request #5 by gareth (2011-10-21 16:51:25+00:00)
Title: Stop catching every 404 error, only catch the ones we couldn't already handle in-app

At the moment, I have some controllers which `rescue_from ActiveRecord::RecordNotFound` and do some custom processing (for example, using the URL to guess which article the user meant to find). I display this to the user and still send a 404 status:

render 'errors/custom404', :status => 404

However, the plugin currently catches this error and returns it to my global ActionController::RoutingError handler. Not too cool.

I've attached an update which uses the same check as ActionDispatch::ShowExceptions (for an `X-Cascade: pass` header instead of for a 404 status). This should ensure that the only errors you're pushing back into the app are the ones which couldn't be handled already. Your plugin isn't very test-ful but I'm using this code successfully in my app now :)