Class: Bearcat::ExtendedRaiseFootrestErrors

Inherits:
Footrest::RaiseFootrestErrors
  • Object
show all
Defined in:
lib/bearcat/client.rb

Overview

Overridden response error middleware that, if an error code doesn’t map to an exception, raises a more generic exception

Instance Method Summary collapse

Instance Method Details

#on_complete(response) ⇒ Object

Raises:

  • ()


114
115
116
117
118
# File 'lib/bearcat/client.rb', line 114

def on_complete(response)
  super
  key = response[:status].to_i
  raise ERROR_MAP[key.floor(-2)], response if key >= 400
end