Class: ErrorNotifier::Rack
- Inherits:
-
Object
- Object
- ErrorNotifier::Rack
- Defined in:
- lib/error_notifier/rack.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
- #extract_data(env) ⇒ Object
-
#initialize(app) ⇒ Rack
constructor
A new instance of Rack.
Constructor Details
#initialize(app) ⇒ Rack
Returns a new instance of Rack.
3 4 5 |
# File 'lib/error_notifier/rack.rb', line 3 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/error_notifier/rack.rb', line 7 def call(env) begin @app.call(env) rescue Exception => e ErrorNotifier.send(e, extract_data(env)) raise end end |
#extract_data(env) ⇒ Object
16 17 18 |
# File 'lib/error_notifier/rack.rb', line 16 def extract_data(env) {:url => env['REQUEST_URI'], :ua => env['HTTP_USER_AGENT']} end |