Exception: Chatrix::RateLimitError

Inherits:
ApiError show all
Defined in:
lib/chatrix/errors.rb

Overview

Error raised when the API request limit is reached.

Instance Attribute Summary collapse

Attributes inherited from ApiError

#api_message, #code, #error

Instance Method Summary collapse

Constructor Details

#initialize(error = {}) ⇒ RateLimitError

Initializes a new RateLimitError instance.

Parameters:

  • error (Hash) (defaults to: {})

    The error response object.



43
44
45
46
# File 'lib/chatrix/errors.rb', line 43

def initialize(error = {})
  super
  @retry_delay = error['retry_after_ms'] if error.key? 'retry_after_ms'
end

Instance Attribute Details

#retry_delayFixnum? (readonly)

Returns number of milliseconds to wait before attempting this request again. If no delay was provided this will be nil.

Returns:

  • (Fixnum, nil)

    number of milliseconds to wait before attempting this request again. If no delay was provided this will be nil.



39
40
41
# File 'lib/chatrix/errors.rb', line 39

def retry_delay
  @retry_delay
end