Sha256: 494e58d6af48ad8ace5bbc6943ddba4162d3e1ec6d68ca0beee8306a1152df5e

Contents?: true

Size: 445 Bytes

Versions: 7

Compression:

Stored size: 445 Bytes

Contents

# frozen_string_literal: true
module Slack
  module Web
    module Api
      module Errors
        class TooManyRequestsError < ::Faraday::Error
          attr_reader :response

          def initialize(response)
            @response = response
            super "Retry after #{retry_after} seconds"
          end

          def retry_after
            response.headers['retry-after'].to_i
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
slack-ruby-client-2.4.0 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-2.3.0 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-2.2.0 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-2.1.0 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-2.0.0 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-1.1.0 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-1.0.0 lib/slack/web/api/errors/too_many_requests_error.rb