Class: Response::RaiseArmoryApiError
- Inherits:
-
Middleware
- Object
- Middleware
- Response::RaiseArmoryApiError
- Defined in:
- lib/faraday/response/raise_armory_api_error.rb
Instance Method Summary collapse
Instance Method Details
#error_message(res) ⇒ Object
15 16 17 |
# File 'lib/faraday/response/raise_armory_api_error.rb', line 15 def (res) "#{res[:method].to_s.upcase} #{res[:url].to_s}: #{res[:body]["reason"]}" end |
#on_complete(res) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/faraday/response/raise_armory_api_error.rb', line 6 def on_complete(res) case res[:status].to_i when 404 raise ArmoryApi::NotFound, (res) when 500 raise ArmoryApi::InternalServerError, (res) end end |