Class: Middleware::ExceptionsHandler

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/chef-licensing/restful_client/middleware/exceptions_handler.rb

Overview

Middleware that handles the exception handler for chef licensing

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
12
# File 'lib/chef-licensing/restful_client/middleware/exceptions_handler.rb', line 8

def call(env)
  @app.call(env)
rescue Faraday::ConnectionFailed => e
  raise ChefLicensing::RestfulClientConnectionError, e.message
end