Exception: Hanko::RateLimitError

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

Overview

Raised when the API returns HTTP 429 Too Many Requests.

Instance Attribute Summary collapse

Attributes inherited from ApiError

#body, #status

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, status: nil, body: nil, retry_after: nil) ⇒ RateLimitError

Returns a new instance of RateLimitError.

Parameters:

  • message (String, nil) (defaults to: nil)

    the error message

  • status (Integer, nil) (defaults to: nil)

    the HTTP status code

  • body (Hash, nil) (defaults to: nil)

    the parsed response body

  • retry_after (Integer, nil) (defaults to: nil)

    seconds to wait before retrying



55
56
57
58
# File 'lib/hanko/errors.rb', line 55

def initialize(message = nil, status: nil, body: nil, retry_after: nil)
  @retry_after = retry_after
  super(message, status: status, body: body)
end

Instance Attribute Details

#retry_afterInteger? (readonly)

Returns seconds to wait before retrying.

Returns:

  • (Integer, nil)

    seconds to wait before retrying



49
50
51
# File 'lib/hanko/errors.rb', line 49

def retry_after
  @retry_after
end