Sha256: 0ac7ff7856cff85c5f9fd87a0920fac434cffad19dffecffc18d51939b1848c0

Contents?: true

Size: 446 Bytes

Versions: 13

Compression:

Stored size: 446 Bytes

Contents

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

13 entries across 13 versions & 1 rubygems

Version Path
slack-ruby-client-0.14.4 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-0.14.3 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-0.14.2 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-0.14.1 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-0.14.0 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-0.13.1 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-0.13.0 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-0.12.0 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-0.11.1 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-0.11.0 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-0.10.0 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-0.9.1 lib/slack/web/api/errors/too_many_requests_error.rb
slack-ruby-client-0.9.0 lib/slack/web/api/errors/too_many_requests_error.rb