Class: Response::RaiseResponseError

Inherits:
Middleware
  • Object
show all
Defined in:
lib/faraday/response/raise_response_error.rb

Instance Method Summary collapse

Instance Method Details

#on_complete(env) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/faraday/response/raise_response_error.rb', line 6

def on_complete(env)
  status = env[:status].to_i

  if (400..599).include?(status)
    raise SaasRunner::ResponseError.new(env)
  end
end