Created
January 23, 2015 23:46
-
-
Save JoshAshby/7f7c01fcb77080635a26 to your computer and use it in GitHub Desktop.
This file contains 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
module Exceptatron | |
class Middleware | |
def initialize app | |
@app = app | |
end | |
def call request | |
raise StandardError.new "Bubbling down" | |
code, headers, body = @app.call request | |
raise StandardError.new "Bubbling up" | |
[code, headers, body] | |
end | |
end | |
end | |
Rails.application.middleware.insert_before Rack::Lock, Exceptatron::Middleware | |
Rails.application.middleware.insert_after Rack::Lock, Exceptatron::Middleware |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment