Class: JMA::Response::RaiseError

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

Overview

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

Instance Method Summary collapse

Instance Method Details

#on_complete(response) ⇒ Object



11
12
13
14
15
# File 'lib/jma/raise_error.rb', line 11

def on_complete(response)
  return unless (error = JMA::Error.from_response(response))

  raise error
end