Class: PostcodeAnywhere::Response::RaiseError
- Inherits:
-
Faraday::Response::Middleware
- Object
- Faraday::Response::Middleware
- PostcodeAnywhere::Response::RaiseError
- Defined in:
- lib/postcode_anywhere/response/raise_error.rb
Instance Method Summary collapse
Instance Method Details
#on_complete(response) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/postcode_anywhere/response/raise_error.rb', line 7 def on_complete(response) status_code = response.status.to_i klass = PostcodeAnywhere::Error.errors[status_code] return unless klass fail(klass.from_response(response)) end |