Class: Zerobounce::Middleware::RaiseHttpException
- Inherits:
-
Faraday::Middleware
- Object
- Faraday::Middleware
- Zerobounce::Middleware::RaiseHttpException
- Defined in:
- lib/zerobounce/middleware/raise_http_exception.rb
Overview
Raises an error if the response wasn’t successful.
Instance Method Summary collapse
-
#on_complete(env) ⇒ Object
Check for errors after the response has finished.
Instance Method Details
#on_complete(env) ⇒ Object
Check for errors after the response has finished.
16 17 18 19 20 |
# File 'lib/zerobounce/middleware/raise_http_exception.rb', line 16 def on_complete(env) if (error = Zerobounce::Error.from_response(env)) # rubocop:disable Style/GuardClause raise error end end |