Class: IronBank::FaradayMiddleware::Response::RaiseError

Inherits:
Faraday::Response::Middleware
  • Object
show all
Defined in:
lib/iron_bank/faraday_middleware/response/raise_error.rb

Overview

This class raises an exception based on the HTTP status code and the ‘success` flag (if present in the response) from Zuora.

Instance Method Summary collapse

Instance Method Details

#on_complete(env) ⇒ Object



12
13
14
# File 'lib/iron_bank/faraday_middleware/response/raise_error.rb', line 12

def on_complete(env)
  (error = IronBank::Error.from_response(env.response)) && raise(error)
end