Class: Revolut::Middleware::CatchError
- Inherits:
-
Faraday::Middleware
- Object
- Faraday::Middleware
- Revolut::Middleware::CatchError
- Defined in:
- lib/revolut/middlewares/catch_error.rb
Instance Method Summary collapse
Instance Method Details
#on_complete(env) ⇒ Object
7 8 9 10 11 |
# File 'lib/revolut/middlewares/catch_error.rb', line 7 def on_complete(env) raise_error_middleware.on_complete(env) rescue Faraday::Error => e raise e, JSON.parse(e.response[:body])["message"] end |