Exception: ResilientCall::CircuitOpenError

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

Overview

Raised when a request is rejected because its named circuit is open.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(circuit_name:, opens_at:, retry_after:, last_error:, message: nil) ⇒ CircuitOpenError

Returns a new instance of CircuitOpenError.



8
9
10
11
12
13
14
# File 'lib/resilient_call/errors.rb', line 8

def initialize(circuit_name:, opens_at:, retry_after:, last_error:, message: nil)
  @circuit_name = circuit_name
  @opens_at     = opens_at
  @retry_after  = retry_after
  @last_error   = last_error
  super(message || "circuit #{circuit_name.inspect} is open")
end

Instance Attribute Details

#circuit_nameObject (readonly)

Returns the value of attribute circuit_name.



6
7
8
# File 'lib/resilient_call/errors.rb', line 6

def circuit_name
  @circuit_name
end

#last_errorObject (readonly)

Returns the value of attribute last_error.



6
7
8
# File 'lib/resilient_call/errors.rb', line 6

def last_error
  @last_error
end

#opens_atObject (readonly)

Returns the value of attribute opens_at.



6
7
8
# File 'lib/resilient_call/errors.rb', line 6

def opens_at
  @opens_at
end

#retry_afterObject (readonly)

Returns the value of attribute retry_after.



6
7
8
# File 'lib/resilient_call/errors.rb', line 6

def retry_after
  @retry_after
end