Errors
Every error is a MirexaError; the module docstring of mirexa.errors explains the families.
- exception mirexa.MirexaError
Bases:
ExceptionBase of every error this package raises.
- exception mirexa.RemoteError(code: int, message: str, retry_after_ms: int = 0)
Bases:
MirexaErrorThe server refused a request with an ERROR frame.
- property retryable: bool
Only
Overloadedis retryable: it is raised before anything is stored, so a re-send is a first attempt.StalePlacementcarries a retry hint too, but is not retryable on the same connection.
- class mirexa.ErrorCode(*values)
ERROR frame codes (the protocol’s v1 vocabulary).
- exception mirexa.OverloadedError(code: int, message: str, retry_after_ms: int = 0)
Bases:
RemoteErrorThe server shed the request before storing anything.
- exception mirexa.UnauthorizedError(code: int, message: str, retry_after_ms: int = 0)
Bases:
RemoteErrorThe token was refused, or does not grant what the request needs.
- exception mirexa.SlowConsumerError(code: int, message: str, retry_after_ms: int = 0)
Bases:
RemoteErrorA subscription was evicted for not reading fast enough.
Bases:
RemoteErrorNo node can currently serve the stream’s partition.
- exception mirexa.RetriesExhaustedError
Bases:
MirexaErrorEvery attempt was shed (
Overloaded).__cause__is the last one.
- exception mirexa.TransportError
Bases:
MirexaErrorThe connection failed: refused, reset, closed or timed out.
- exception mirexa.AmbiguousWriteError
Bases:
TransportErrorThe connection failed with a write in flight; its outcome is unknown.
The batch may have been applied with only the acknowledgement lost. Reconcile by querying the range back. Re-sending a CANDLE batch is also safe: a bar the node already holds is restated and an identical one skipped. It is not done for you, because a re-send overwrites any bar someone else restated in between, and a trade batch has no such key — two trades may share a timestamp, so a re-send can store one twice.
- exception mirexa.ClientClosedError
Bases:
TransportErrorThe client, or its connection, is closed.
- exception mirexa.RequestTimeoutError
Bases:
TransportErrorNo response arrived within the request timeout.
- exception mirexa.QueryStatusError(status: int, stream: object)
Bases:
MirexaErrorA query answered with a non-OK status.
- exception mirexa.StreamNotFoundError(status: int, stream: object)
Bases:
QueryStatusErrorThe node has no such stream.
- exception mirexa.RedirectError(partition: int, epoch: int, node_id: int, addr: str)
Bases:
MirexaErrorAnother node serves this stream. This client does not route (yet).
- exception mirexa.DerivedStreamError(code: int, message: str, retry_after_ms: int = 0)
Bases:
RemoteErrorA write to a DERIVED stream without
overwrite=True. The node writes that stream itself from its source; nothing was stored. Re-send withoverwrite=Trueonly if replacing derived bars is what you mean.
- exception mirexa.WireFormatError
Bases:
MirexaErrorA payload that does not decode (the server’s
ErrPayloadFormat).