Exception: ApiBrasil::Core::Errors::RateLimitError

Inherits:
ApiBrasilError
  • Object
show all
Defined in:
lib/api_brasil/core/errors.rb

Overview

HTTP 429 - rate limit atingido.

Instance Attribute Summary collapse

Attributes inherited from ApiBrasilError

#error_code, #previous, #response, #status

Instance Method Summary collapse

Methods inherited from ApiBrasilError

from, #insufficient_balance?, #unauthorized?

Constructor Details

#initialize(message, retry_after_ms: nil, **options) ⇒ RateLimitError

Returns a new instance of RateLimitError.



88
89
90
91
# File 'lib/api_brasil/core/errors.rb', line 88

def initialize(message, retry_after_ms: nil, **options)
  super(message, **options)
  @retry_after_ms = retry_after_ms
end

Instance Attribute Details

#retry_after_msInteger? (readonly)

Returns espera sugerida pelo servidor (header Retry-After), em ms.

Returns:

  • (Integer, nil)

    espera sugerida pelo servidor (header Retry-After), em ms.



86
87
88
# File 'lib/api_brasil/core/errors.rb', line 86

def retry_after_ms
  @retry_after_ms
end