Class: Revolut::Middleware::RaiseError

Inherits:
Faraday::Response::Middleware
  • Object
show all
Defined in:
lib/revolut/middleware/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



9
10
11
12
# File 'lib/revolut/middleware/raise_error.rb', line 9

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