Errors
What a read can raise. Execution methods never raise; they return a result.
MfxError (Exception)
Every failure this SDK raises.
MfxTransportError (MfxError)
The request never got an answer: DNS, TCP, TLS, a dropped connection.
MfxTimeout (MfxTransportError)
The request got no answer in time. Never retried by the SDK for a write.
MfxApiError (MfxError)
MFX answered, and the answer was a failure.
ValidationError (MfxApiError)
The request was refused before anything happened: 400, or 422 for an unsupported broker.
AuthError (MfxApiError)
The signature, key, timestamp or nonce was not accepted.
ForbiddenError (MfxApiError)
The key is valid and this is not in its scopes.
TenantDisabledError (ForbiddenError)
The operator has disabled this tenant: every call is refused until it is enabled.
Nothing is wrong with the key, its scopes or the request, and retrying changes nothing: it ends when the operator enables the tenant. message is what the operator wrote for the tenant, word for word, and is the thing to show or log. The tenant's terminals keep running meanwhile. An open stream is closed with the same error.
When the tenant was disabled; None if the platform did not say.
TenantSuspendedError (ForbiddenError)
The operator has suspended this tenant: writes are refused now, reads for a while yet.
Orders, closes and every other write are refused from the moment of suspension. Reads and the stream go on working until reads_until, the end of the suspension's grace, and are then refused with this same error. It is not retryable: it ends when the operator resumes the tenant. message is what the operator wrote for the tenant, word for word.
Execution methods never raise: a suspended tenant's order comes back as a refused ExecutionResult whose detail carries this error's text.
When the suspension began; None if the platform did not say.
When reads stop working too; None if the platform named no grace.
MaintenanceError (ForbiddenError)
A planned maintenance window suspends this for you until ends_at.
403 maintenance. Nothing is wrong with the key or the request: it works again when the window ends, so wait until ends_at and send it again (the same idempotency key for a write). Only the window's own scope is refused, and open positions are never closed by a window. message is the platform's sentence ("Paused for planned maintenance until 02:38 UTC.") and is the part to show a person; client.maintenance.list says what else is suspended and is answered throughout.
The window's id, for client.maintenance.terminals(window_id).
The window's label as people say it: MW-0031.
The window's current end, aware; None if the platform did not say. It can move.
The suspended service that refused this call, e.g. order_placement.
Every service the window suspends for you.
NotFoundError (MfxApiError)
No such object for this tenant. Another tenant's id is a 404 here, never a 403.
ConflictError (MfxApiError)
The request cannot apply to the object as it is now.
StateError (ConflictError)
The object is in a state this cannot be done from.
PlacementError (ConflictError)
No farm can carry what was asked for.
UnsupportedBrokerError (ConflictError)
MFX does not support this broker or this server now.
Refused at request time and never passed to a terminal, so a tenant learns it here rather than from a terminal that sits in REQUESTED and never moves. message is the sentence an operator recorded, which is the part worth showing a user; the rest says which of the two switches was closed:
refused_by — permission (the broker's legal position: MFX may not carry it for this tenant) or server_disabled (the broker is fine, this one server is switched off). reason, broker_id, server_id — as the platform recorded them.
The distinction matters to a caller: server_disabled means try another server of the same broker, permission means this broker is not available at all.
permission or server_disabled; None if the platform did not say.
The platform's own reason code, unbucketed.
RateLimitError (MfxApiError)
The key is over its budget. retry_after_s is the server's own answer.
UpstreamError (MfxApiError)
Something MFX depends on did not answer as it needs: your terminal, the broker, or a service of its own. Always 503 from the platform, told apart by error.code:
upstream_error - your terminal or the broker, raised as this class: reason says why where there is one (terminal_timeout, deals_unreadable, no_tick ...). No Retry-After: whether waiting helps depends on the terminal, so read its state first. dependency_unavailable - a store of the platform's own, raised as DependencyUnavailableError; retry_after_s says when.
The platform never answers 502 or 504. One of those came from the network in between (the edge's own page, with no MFX body), and is raised as EdgeError, from_edge true. Both are subclasses, so except UpstreamError still catches all three.
The platform's word for what failed (details.reason), or None when it gave none.
True for a 502 or 504: not the platform's answer, the network's.
DependencyUnavailableError (UpstreamError)
503 dependency_unavailable: a store of the platform's own did not answer.
Not your terminal and not the broker: the request was valid, and waiting retry_after_s and sending it again is the right thing to do.
EdgeError (UpstreamError)
A 502 or 504 with no MFX body: the network in front of MFX Hub answered, not the platform.
MFX Hub never answers either itself, so this says the platform could not be reached, not that it failed. A write may or may not have arrived: retry it with the same idempotency key, which answers the original if it did.
InternalError (MfxApiError)
MFX failed, and it is not the caller's request that is wrong.