Exception: DilisensePepClient::CircuitBreaker::CircuitOpenError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/dilisense_pep_client/circuit_breaker.rb

Overview

Exception raised when the circuit breaker is in the OPEN state Indicates that requests are being blocked to protect the downstream service

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service_name, next_attempt_time) ⇒ CircuitOpenError

Returns a new instance of CircuitOpenError.



49
50
51
52
53
# File 'lib/dilisense_pep_client/circuit_breaker.rb', line 49

def initialize(service_name, next_attempt_time)
  super("Circuit breaker is OPEN for #{service_name}. Next attempt allowed at #{next_attempt_time}")
  @service_name = service_name
  @next_attempt_time = next_attempt_time
end

Instance Attribute Details

#next_attempt_timeObject (readonly)

Returns the value of attribute next_attempt_time.



55
56
57
# File 'lib/dilisense_pep_client/circuit_breaker.rb', line 55

def next_attempt_time
  @next_attempt_time
end

#service_nameObject (readonly)

Returns the value of attribute service_name.



55
56
57
# File 'lib/dilisense_pep_client/circuit_breaker.rb', line 55

def service_name
  @service_name
end