Exception: JetstreamBridge::RetryExhausted

Inherits:
Error
  • Object
show all
Defined in:
lib/jetstream_bridge/errors.rb

Overview

Retry errors

Instance Attribute Summary collapse

Attributes inherited from Error

#context

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, attempts: 0, original_error: nil, context: {}) ⇒ RetryExhausted

Returns a new instance of RetryExhausted.



82
83
84
85
86
87
88
89
# File 'lib/jetstream_bridge/errors.rb', line 82

def initialize(message = nil, attempts: 0, original_error: nil, context: {})
  @attempts = attempts
  @original_error = original_error
  super(
    message || "Failed after #{attempts} attempts: #{original_error&.message}",
    context: context.merge(attempts: attempts).compact
  )
end

Instance Attribute Details

#attemptsObject (readonly)

Returns the value of attribute attempts.



80
81
82
# File 'lib/jetstream_bridge/errors.rb', line 80

def attempts
  @attempts
end

#original_errorObject (readonly)

Returns the value of attribute original_error.



80
81
82
# File 'lib/jetstream_bridge/errors.rb', line 80

def original_error
  @original_error
end