Class: ClickHouse::Middleware::RaiseError

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/click_house/middleware/raise_error.rb

Constant Summary collapse

SUCCEED_STATUSES =
(200..299).freeze

Instance Method Summary collapse

Instance Method Details

#call(environment) ⇒ Object


10
11
12
13
14
# File 'lib/click_house/middleware/raise_error.rb', line 10

def call(environment)
  @app.call(environment).on_complete(&method(:on_complete))
rescue Faraday::ConnectionFailed => e
  raise NetworkException, e.message, e.backtrace
end