Exception: Tenax::CircuitOpenError

Inherits:
ExecutionError show all
Defined in:
lib/tenax/errors.rb

Overview

Raised when a circuit breaker is open and rejects the operation without attempting it.

Instance Attribute Summary collapse

Attributes inherited from ExecutionError

#attempts, #profile_name

Instance Method Summary collapse

Constructor Details

#initialize(profile_name:, opened_at:) ⇒ CircuitOpenError

Returns a new instance of CircuitOpenError.



91
92
93
94
95
96
97
98
# File 'lib/tenax/errors.rb', line 91

def initialize(profile_name:, opened_at:)
  @opened_at = opened_at
  super(
    "circuit breaker for profile #{profile_name.inspect} is open (opened at #{opened_at})",
    profile_name: profile_name,
    attempts: 0
  )
end

Instance Attribute Details

#opened_at ⇒ Object (readonly)

Returns the value of attribute opened_at.



89
90
91
# File 'lib/tenax/errors.rb', line 89

def opened_at
  @opened_at
end