Exception: ResilientCall::CircuitOpenError
- Inherits:
-
StandardError
- Object
- StandardError
- ResilientCall::CircuitOpenError
- Defined in:
- lib/resilient_call/errors.rb
Overview
Raised when a request is rejected because its named circuit is open.
Instance Attribute Summary collapse
-
#circuit_name ⇒ Object
readonly
Returns the value of attribute circuit_name.
-
#last_error ⇒ Object
readonly
Returns the value of attribute last_error.
-
#opens_at ⇒ Object
readonly
Returns the value of attribute opens_at.
-
#retry_after ⇒ Object
readonly
Returns the value of attribute retry_after.
Instance Method Summary collapse
-
#initialize(circuit_name:, opens_at:, retry_after:, last_error:, message: nil) ⇒ CircuitOpenError
constructor
A new instance of CircuitOpenError.
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( || "circuit #{circuit_name.inspect} is open") end |
Instance Attribute Details
#circuit_name ⇒ Object (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_error ⇒ Object (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_at ⇒ Object (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_after ⇒ Object (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 |