Exception: SecApi::ReconnectionError
- Inherits:
-
NetworkError
- Object
- StandardError
- Error
- TransientError
- NetworkError
- SecApi::ReconnectionError
- Defined in:
- lib/sec_api/errors/reconnection_error.rb
Overview
Raised when WebSocket reconnection fails after maximum attempts.
This is a TransientError (the underlying cause was likely temporary) but after exhausting retries, we give up and surface to the caller.
Instance Attribute Summary collapse
-
#attempts ⇒ Integer
readonly
Number of reconnection attempts made.
-
#downtime_seconds ⇒ Float
readonly
Total downtime in seconds.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(message:, attempts:, downtime_seconds:, request_id: nil) ⇒ ReconnectionError
constructor
A new instance of ReconnectionError.
Constructor Details
#initialize(message:, attempts:, downtime_seconds:, request_id: nil) ⇒ ReconnectionError
Returns a new instance of ReconnectionError.
28 29 30 31 32 |
# File 'lib/sec_api/errors/reconnection_error.rb', line 28 def initialize(message:, attempts:, downtime_seconds:, request_id: nil) @attempts = attempts @downtime_seconds = downtime_seconds super(, request_id: request_id) end |
Instance Attribute Details
#attempts ⇒ Integer (readonly)
Returns Number of reconnection attempts made.
19 20 21 |
# File 'lib/sec_api/errors/reconnection_error.rb', line 19 def attempts @attempts end |
#downtime_seconds ⇒ Float (readonly)
Returns Total downtime in seconds.
22 23 24 |
# File 'lib/sec_api/errors/reconnection_error.rb', line 22 def downtime_seconds @downtime_seconds end |