Exception: LetMeSendEmail::RateLimitError

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

Overview

HTTP 429 failure with rate-limit metadata.

Instance Attribute Summary collapse

Attributes inherited from Error

#api_code, #raw_body, #request_id, #response_headers, #status_code, #validation_errors

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, status_code: nil, api_code: nil, validation_errors: nil, request_id: nil, response_headers: nil, raw_body: nil, retry_after: nil, limit: nil, remaining: nil, reset_at: nil) ⇒ RateLimitError

Returns a new instance of RateLimitError.



34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/letmesendemail/errors.rb', line 34

def initialize(message = nil, status_code: nil, api_code: nil,
               validation_errors: nil, request_id: nil,
               response_headers: nil, raw_body: nil,
               retry_after: nil, limit: nil, remaining: nil, reset_at: nil)
  super(message, status_code: status_code, api_code: api_code,
                 validation_errors: validation_errors, request_id: request_id,
                 response_headers: response_headers, raw_body: raw_body)
  @retry_after = retry_after
  @limit = limit
  @remaining = remaining
  @reset_at = reset_at
end

Instance Attribute Details

#limitObject (readonly)

Returns the value of attribute limit.



32
33
34
# File 'lib/letmesendemail/errors.rb', line 32

def limit
  @limit
end

#remainingObject (readonly)

Returns the value of attribute remaining.



32
33
34
# File 'lib/letmesendemail/errors.rb', line 32

def remaining
  @remaining
end

#reset_atObject (readonly)

Returns the value of attribute reset_at.



32
33
34
# File 'lib/letmesendemail/errors.rb', line 32

def reset_at
  @reset_at
end

#retry_afterObject (readonly)

Returns the value of attribute retry_after.



32
33
34
# File 'lib/letmesendemail/errors.rb', line 32

def retry_after
  @retry_after
end