Class: Croudia::Request::RaiseError

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/croudia/request/raise_error.rb

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/croudia/request/raise_error.rb', line 7

def call(env)
  @app.call(env)
rescue Faraday::Error::TimeoutError => e
  raise Croudia::Error::Timeout.new(e)
rescue Faraday::Error::ConnectionFailed => e
  raise Croudia::Error::NetworkError.new(e)
end