Exception: ResilientCall::RetriesExhaustedError

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

Overview

Raised when all configured retries have been exhausted without success. The original exception is available through Ruby’s native ‘#cause` chain when this error is raised from inside a rescue block.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attempts:, message: nil) ⇒ RetriesExhaustedError

Returns a new instance of RetriesExhaustedError.



23
24
25
26
# File 'lib/resilient_call/errors.rb', line 23

def initialize(attempts:, message: nil)
  @attempts = attempts
  super(message || "exhausted after #{attempts} attempt(s)")
end

Instance Attribute Details

#attemptsObject (readonly)

Returns the value of attribute attempts.



21
22
23
# File 'lib/resilient_call/errors.rb', line 21

def attempts
  @attempts
end