Class: FrontendRescue::Middleware
- Inherits:
-
Object
- Object
- FrontendRescue::Middleware
- Defined in:
- lib/frontend_rescue/middleware.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, opts = {}, &block) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app, opts = {}, &block) ⇒ Middleware
Returns a new instance of Middleware.
5 6 7 8 9 |
# File 'lib/frontend_rescue/middleware.rb', line 5 def initialize(app, opts={}, &block) @app = app @opts = .merge(opts) @block = block end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/frontend_rescue/middleware.rb', line 11 def call(env) if frontend_error_request?(env) handle_error Rack::Request.new(env) else @app.call(env) end end |