Sha256: 844c60c219651319217e61d594396f2d93cf7e4d59060995e4c23300ce924226

Contents?: true

Size: 476 Bytes

Versions: 6

Compression:

Stored size: 476 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
          end

          def message
            "Retry after #{retry_after} seconds"
          end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
slack-ruby-client-0.17.0 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-0.16.0 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-0.15.1 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-0.15.0 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-0.14.6 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-0.14.5 lib/slack/web/api/errors/too_many_requests_error.rb