Exception: DiscordStore::RateLimitedError

Inherits:
APIError
  • Object
show all
Defined in:
lib/discord_store/errors.rb

Overview

429 — rate limited. Carries the server-supplied backoff so callers can obey it rather than guessing.

Instance Attribute Summary collapse

Attributes inherited from APIError

#code, #response_body, #status

Instance Method Summary collapse

Constructor Details

#initialize(message, retry_after:, scope: nil, global: false, **kwargs) ⇒ RateLimitedError

Returns a new instance of RateLimitedError.



61
62
63
64
65
66
# File 'lib/discord_store/errors.rb', line 61

def initialize(message, retry_after:, scope: nil, global: false, **kwargs)
  @retry_after = retry_after
  @scope = scope
  @global = global
  super(message, **kwargs)
end

Instance Attribute Details

#global ⇒ Object (readonly)

Returns the value of attribute global.



59
60
61
# File 'lib/discord_store/errors.rb', line 59

def global
  @global
end

#retry_after ⇒ Object (readonly)

Returns the value of attribute retry_after.



59
60
61
# File 'lib/discord_store/errors.rb', line 59

def retry_after
  @retry_after
end

#scope ⇒ Object (readonly)

Returns the value of attribute scope.



59
60
61
# File 'lib/discord_store/errors.rb', line 59

def scope
  @scope
end