Exception: OpenReceive::Server::RateLimitedError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/openreceive/server/errors.rb

Overview

429 — the payer exceeded the configured invoice-creation budget. Mirrors the JS handler: RATE_LIMITED with retryable: true so clients back off and retry instead of treating it as a permanent failure, plus a Retry-After hint (seconds) emitted as a response header.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = "Too many requests.") ⇒ RateLimitedError

Returns a new instance of RateLimitedError.



144
145
146
147
148
149
150
# File 'lib/openreceive/server/errors.rb', line 144

def initialize(message = "Too many requests.")
  super(message)
  @status = 429
  @code = "RATE_LIMITED"
  @retryable = true
  @retry_after_seconds = 60
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



142
143
144
# File 'lib/openreceive/server/errors.rb', line 142

def code
  @code
end

#retry_after_secondsObject (readonly)

Returns the value of attribute retry_after_seconds.



142
143
144
# File 'lib/openreceive/server/errors.rb', line 142

def retry_after_seconds
  @retry_after_seconds
end

#retryableObject (readonly)

Returns the value of attribute retryable.



142
143
144
# File 'lib/openreceive/server/errors.rb', line 142

def retryable
  @retryable
end

#statusObject (readonly)

Returns the value of attribute status.



142
143
144
# File 'lib/openreceive/server/errors.rb', line 142

def status
  @status
end