Class: HookDeck::Middleware::ErrorHandler
- Inherits:
-
Faraday::Middleware
- Object
- Faraday::Middleware
- HookDeck::Middleware::ErrorHandler
- Defined in:
- lib/hookdeck/middlewares/error_handler.rb
Overview
ErrorHandler is a Faraday middleware that provides standardized error handling for HTTP requests. It catches Faraday errors and converts them into specific HookDeck error types based on the response status and error type
Instance Method Summary collapse
-
#call(env) ⇒ Object
Executes the middleware.
Instance Method Details
#call(env) ⇒ Object
Executes the middleware
13 14 15 16 17 |
# File 'lib/hookdeck/middlewares/error_handler.rb', line 13 def call(env) @app.call(env) rescue Faraday::Error => e handle_error(e, env) end |