Class: Ivapi::Response::RaiseError

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

Overview

This class raises an exception based HTTP status codes returned by the API.

Instance Method Summary collapse

Instance Method Details

#on_complete(response) ⇒ Object



12
13
14
15
# File 'lib/ivapi/response/raise_error.rb', line 12

def on_complete(response)
  error = Ivapi::Error.from_response(response)
  raise error if error
end