Class: Cortex::FaradayMiddleware::ResponseFailures

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/cortex/faraday_middleware/response_failures.rb

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/cortex/faraday_middleware/response_failures.rb', line 8

def call(env)
  begin
    @app.call(env)
  rescue Faraday::ConnectionFailed
    raise Cortex::Exceptions::ConnectionFailed.new(base_url: env[:url])
  end
end