5. Exceptions

Exceptions

exception trainlib_async.exc.TrainlibError

Bases: Exception

Base error.

exception trainlib_async.exc.TrainNotFoundError

Bases: TrainlibError

If the train we search for, or no train at all is found.

exception trainlib_async.exc.TrainNotConnectedError

Bases: TrainlibError

In case the train disconnected or wasn’t connected yet.

exception trainlib_async.exc.TrainMessageTypeError

Bases: TrainlibError

Incorrect message type was expected.

exception trainlib_async.exc.TrainMessageLengthError

Bases: TrainlibError

The length of the received message is shorter than expected and cannot be parsed.

exception trainlib_async.exc.TrainMessageInterpretationError

Bases: TrainlibError

Structure unpacking failed.

exception trainlib_async.exc.TrainCommandError

Bases: TrainlibError

Command building error.