Created
June 14, 2010 21:46
-
-
Save tammersaleh/438363 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RoutingErrorRaiser | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
status, headers, body = @app.call(env) | |
raise ActionController::RoutingError, "No route matches #{env['PATH_INFO'].inspect}" if headers['X-Cascade'] == 'pass' | |
[status, headers, body] | |
end | |
end | |
Lettercase::Application.configure do | |
config.middleware.use ::RoutingErrorRaiser |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment