Class: Redd::Response::RaiseError
- Inherits:
-
Faraday::Response::Middleware
- Object
- Faraday::Response::Middleware
- Redd::Response::RaiseError
- Defined in:
- lib/redd/response/raise_error.rb
Overview
Faraday Middleware that raises an error if there’s one.
Instance Method Summary collapse
Instance Method Details
#on_complete(env) ⇒ Object
10 11 12 13 |
# File 'lib/redd/response/raise_error.rb', line 10 def on_complete(env) error = Redd::Error.from_response(env) fail error.new(env), env[:body] if error end |