Class: AppfluxRuby::Rack::Middleware
- Inherits:
-
Object
- Object
- AppfluxRuby::Rack::Middleware
- Defined in:
- lib/appflux_ruby/rack/middleware.rb
Instance Method Summary collapse
-
#call(env) ⇒ Object
Intercepts exception and sends notification to API.
-
#initialize(app) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app) ⇒ Middleware
Returns a new instance of Middleware.
4 5 6 |
# File 'lib/appflux_ruby/rack/middleware.rb', line 4 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
Intercepts exception and sends notification to API.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/appflux_ruby/rack/middleware.rb', line 10 def call(env) begin AppfluxRuby::Bugflux.initialize_additional_data response = @app.call(env) rescue Exception => ex # TODO: Need to figure out a logger implementation. ::AppfluxRuby::BugfluxNotifier.notify(ex, env) raise ex end end |