class Acme::Client::HTTPClient::ErrorMiddleware

ErrorMiddleware ensures the HTTP Client would not raise exceptions outside the Acme namespace.

Exceptions are rescued and re-packaged as Acme exceptions.

Public Instance Methods

call(env) click to toggle source

Implements the Rack-alike Faraday::Middleware interface.

# File lib/acme/client/http_client.rb, line 48
def call(env)
  @app.call(env)
rescue Faraday::TimeoutError, Faraday::ConnectionFailed
  raise Acme::Client::Error::Timeout
end