class Slack::Web::Faraday::Response::WrapError

Constants

UNAVAILABLE_ERROR_STATUSES

Public Instance Methods

call(env) click to toggle source
Calls superclass method
# File lib/slack/web/faraday/response/wrap_error.rb, line 15
def call(env)
  super
rescue ::Faraday::TimeoutError, ::Faraday::ConnectionFailed
  raise Slack::Web::Api::Errors::TimeoutError.new('timeout_error', env.response)
end
on_complete(env) click to toggle source
# File lib/slack/web/faraday/response/wrap_error.rb, line 9
def on_complete(env)
  return unless UNAVAILABLE_ERROR_STATUSES.cover?(env.status)

  raise Slack::Web::Api::Errors::UnavailableError.new('unavailable_error', env.response)
end