Exception: JetstreamBridge::RetryExhausted
- Defined in:
- lib/jetstream_bridge/errors.rb
Overview
Raised when all retry attempts have been exhausted.
Instance Attribute Summary collapse
-
#attempts ⇒ Integer
readonly
Total number of attempts made.
-
#original_error ⇒ Exception?
readonly
The last error that triggered the retry.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(message = nil, attempts: 0, original_error: nil, context: {}) ⇒ RetryExhausted
constructor
A new instance of RetryExhausted.
Constructor Details
#initialize(message = nil, attempts: 0, original_error: nil, context: {}) ⇒ RetryExhausted
Returns a new instance of RetryExhausted.
141 142 143 144 145 146 147 148 |
# File 'lib/jetstream_bridge/errors.rb', line 141 def initialize( = nil, attempts: 0, original_error: nil, context: {}) @attempts = attempts @original_error = original_error super( || "Failed after #{attempts} attempts: #{original_error&.message}", context: context.merge(attempts: attempts).compact ) end |
Instance Attribute Details
#attempts ⇒ Integer (readonly)
Returns Total number of attempts made.
133 134 135 |
# File 'lib/jetstream_bridge/errors.rb', line 133 def attempts @attempts end |
#original_error ⇒ Exception? (readonly)
Returns The last error that triggered the retry.
135 136 137 |
# File 'lib/jetstream_bridge/errors.rb', line 135 def original_error @original_error end |