class Notion::Faraday::Response::WrapError

Constants

UNAVAILABLE_ERROR_STATUSES

Public Instance Methods

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

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