Class: PagerDuty::Connection::RaiseRateLimitOn429

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/pager_duty/connection.rb

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



82
83
84
85
86
87
88
89
# File 'lib/pager_duty/connection.rb', line 82

def call(env)
  response = @app.call env
  if response.status == 429
    raise RateLimitError, response.env[:url].to_s
  end

  response
end