Exception: Sendly::RateLimitError

Inherits:
Error
  • Object
show all
Defined in:
lib/sendly/errors.rb

Overview

Raised when the rate limit is exceeded

Instance Attribute Summary collapse

Attributes inherited from Error

#code, #details, #status_code

Instance Method Summary collapse

Constructor Details

#initialize(message = "Rate limit exceeded", retry_after: nil) ⇒ RateLimitError

Returns a new instance of RateLimitError.



35
36
37
38
# File 'lib/sendly/errors.rb', line 35

def initialize(message = "Rate limit exceeded", retry_after: nil)
  @retry_after = retry_after
  super(message, code: "RATE_LIMIT_EXCEEDED", status_code: 429)
end

Instance Attribute Details

#retry_afterInteger? (readonly)

Returns Seconds to wait before retrying.

Returns:

  • (Integer, nil)

    Seconds to wait before retrying



33
34
35
# File 'lib/sendly/errors.rb', line 33

def retry_after
  @retry_after
end