Exception: Mercadopago::MPRateLimitError

Inherits:
MercadoPagoError show all
Defined in:
lib/mercadopago/errors/exceptions.rb

Overview

HTTP 429 Too Many Requests. Exposes retry_after (seconds) from the Retry-After response header.

Instance Attribute Summary collapse

Attributes inherited from MercadoPagoError

#causes, #error, #request_id, #status_code

Instance Method Summary collapse

Constructor Details

#initialize(status_code, response_body = nil, retry_after = nil, request_id = nil) ⇒ MPRateLimitError

Returns a new instance of MPRateLimitError.



64
65
66
67
# File 'lib/mercadopago/errors/exceptions.rb', line 64

def initialize(status_code, response_body = nil, retry_after = nil, request_id = nil)
  super(status_code, response_body, request_id)
  @retry_after = retry_after
end

Instance Attribute Details

#retry_afterInteger? (readonly)

seconds to wait before retrying

Returns:

  • (Integer, nil)

    the current value of retry_after



61
62
63
# File 'lib/mercadopago/errors/exceptions.rb', line 61

def retry_after
  @retry_after
end