Class: Rack::RedAlert

Inherits:
Object
  • Object
show all
Defined in:
lib/red_alert/rack/middleware.rb

Instance Method Summary collapse

Constructor Details

#initialize(inner, settings) ⇒ RedAlert

Returns a new instance of RedAlert.



3
4
5
6
# File 'lib/red_alert/rack/middleware.rb', line 3

def initialize(inner, settings)
  @inner = inner
  @settings = settings
end

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/red_alert/rack/middleware.rb', line 8

def call(env)
  @inner.call env
rescue => e
  notification = ::RedAlert::Rack::Notifier.build @settings
  notification.alert e, env: env
  raise e
end