Errors¶
Everything tickgym raises is a TickGymError, except the plain ValueError or TypeError for an
argument that is out of range or of the wrong type before any request is made. All of them pickle, so a worker’s
failure crosses a process pool intact.
Three things can go wrong:
The gym refused a request: a
GymErrorwith a subclass perErrorCode. The gym is still usable, and a refused step changed nothing.The connection is gone:
TransportErrororProtocolError. The gym is closed, and whether the last request ran is unknown. Open a new gym and reset; the exported record steps it back to where it was.
- exception TickGymError¶
The base class of the SDK’s own errors.
- exception TickError(status: int, code: str, message: str)¶
TICK refused a request, or could not be reached.
- exception GymError(code: ErrorCode, detail: str)¶
The server refused a request on the gym’s connection.
- exception TransportError¶
The connection failed, timed out, or was already closed. The gym is closed; open a new one and reset.
- exception ProtocolError¶
A frame the client could not read, or an answer of the wrong kind. The gym closes: its state is no longer known.
Refusals¶
- exception BadActionError(code: ErrorCode, detail: str)¶
An action was refused: its tick is outside the step’s window, its kind is unknown, or its value is out of range.
- exception SnapshotUnknownError(code: ErrorCode, detail: str)¶
The snapshot id names no snapshot of this gym.
- exception SnapshotLimitError(code: ErrorCode, detail: str)¶
The gym holds its maximum number of snapshots; discard one first.
- exception CapacityError(code: ErrorCode, detail: str)¶
The server has no gym slot free; close a gym or wait.
- exception SessionUnknownError(code: ErrorCode, detail: str)¶
The session id names no session: it was closed, or the server restarted.
- exception SchemaMismatchError(code: ErrorCode, detail: str)¶
This package was built for a different server version: use the tickgym that matches the server.
- exception ProtocolVersionError(code: ErrorCode, detail: str)¶
The client and the server speak different protocol versions.
- exception BadEntryError(code: ErrorCode, detail: str)¶
A request body was malformed: a frame or a record the server could not read.