Class: Luchadeer::Middleware::ParseHTTPError

Inherits:
Faraday::Response::Middleware
  • Object
show all
Defined in:
lib/luchadeer/middleware/parse_http_error.rb

Instance Method Summary collapse

Instance Method Details

#on_complete(response) ⇒ Object



8
9
10
11
12
# File 'lib/luchadeer/middleware/parse_http_error.rb', line 8

def on_complete(response)
  klass = Luchadeer::Error.http_errors[response.status.to_i]

  fail(klass.new) if klass
end