# API Reference v10.3.1 (Python)

## MotionLibException (class)

Module: zaber_motion.exceptions

Exception originating in the library.

To use this type, add `from zaber_motion.exceptions import MotionLibException` to the top of your source code.

Related Guides:

- [Error handling](https://software.zaber.com/motion-library/docs/guides/library_features/error_handling.md)

### Properties

#### `message` (read-only)

`motion_lib_exception.message`

Type: `str`

Error message of the exception.

### Methods

#### `__repr__()`

`motion_lib_exception.__repr__()`

Returns a string that represents the exception.

##### Return Value

Type: `str`

A string that represents the exception.

## Subclasses of MotionLibException

| Exception | Description |
| --- | --- |
| [BadCommandException](https://software.zaber.com/motion-library/api/py/exceptions/badcommandexception.md) | Thrown when a device receives an invalid command. |
| [BadDataException](https://software.zaber.com/motion-library/api/py/exceptions/baddataexception.md) | Thrown when a parameter of a command is judged to be out of range by the receiving device. |
| [BinaryCommandFailedException](https://software.zaber.com/motion-library/api/py/exceptions/binarycommandfailedexception.md) | Thrown when a device rejects a binary command with an error. Details Type: [`BinaryCommandFailedExceptionData`](https://software.zaber.com/motion-library/api/py/exceptions/binarycommandfailedexceptiondata.md) |
| [CommandFailedException](https://software.zaber.com/motion-library/api/py/exceptions/commandfailedexception.md) | Thrown when a device rejects a command. Details Type: [`CommandFailedExceptionData`](https://software.zaber.com/motion-library/api/py/exceptions/commandfailedexceptiondata.md) |
| [CommandPreemptedException](https://software.zaber.com/motion-library/api/py/exceptions/commandpreemptedexception.md) | Thrown when a movement command gets preempted by another command. |
| [CommandTooLongException](https://software.zaber.com/motion-library/api/py/exceptions/commandtoolongexception.md) | Thrown when a command is too long to be written by the ASCII protocol, even when continued across multiple lines. Details Type: [`CommandTooLongExceptionData`](https://software.zaber.com/motion-library/api/py/exceptions/commandtoolongexceptiondata.md) |
| [ConnectionClosedException](https://software.zaber.com/motion-library/api/py/exceptions/connectionclosedexception.md) | Thrown when attempting to communicate on a closed connection. |
| [ConnectionFailedException](https://software.zaber.com/motion-library/api/py/exceptions/connectionfailedexception.md) | Thrown when a connection breaks during a request. |
| [ConversionFailedException](https://software.zaber.com/motion-library/api/py/exceptions/conversionfailedexception.md) | Thrown when a value cannot be converted using the provided units. |
| [DeviceAddressConflictException](https://software.zaber.com/motion-library/api/py/exceptions/deviceaddressconflictexception.md) | Thrown when there is a conflict in device numbers preventing unique addressing. Details Type: [`DeviceAddressConflictExceptionData`](https://software.zaber.com/motion-library/api/py/exceptions/deviceaddressconflictexceptiondata.md) |
| [DeviceBusyException](https://software.zaber.com/motion-library/api/py/exceptions/devicebusyexception.md) | Thrown when a requested operation fails because the device is currently busy. |
| [DeviceDbFailedException](https://software.zaber.com/motion-library/api/py/exceptions/devicedbfailedexception.md) | Thrown when device information cannot be retrieved from the device database. Details Type: [`DeviceDbFailedExceptionData`](https://software.zaber.com/motion-library/api/py/exceptions/devicedbfailedexceptiondata.md) |
| [DeviceDetectionFailedException](https://software.zaber.com/motion-library/api/py/exceptions/devicedetectionfailedexception.md) | Thrown when device detection fails. |
| [DeviceFailedException](https://software.zaber.com/motion-library/api/py/exceptions/devicefailedexception.md) | Thrown when a device registers fatal failure. Contact support if you observe this exception. |
| [DeviceNotIdentifiedException](https://software.zaber.com/motion-library/api/py/exceptions/devicenotidentifiedexception.md) | Thrown when attempting an operation that requires an identified device. |
| [DriverDisabledException](https://software.zaber.com/motion-library/api/py/exceptions/driverdisabledexception.md) | Thrown when a device cannot carry out a movement command because the motor driver is disabled. |
| [GCodeExecutionException](https://software.zaber.com/motion-library/api/py/exceptions/gcodeexecutionexception.md) | Thrown when a block of G-Code cannot be executed. Details Type: [`GCodeExecutionExceptionData`](https://software.zaber.com/motion-library/api/py/exceptions/gcodeexecutionexceptiondata.md) |
| [GCodeSyntaxException](https://software.zaber.com/motion-library/api/py/exceptions/gcodesyntaxexception.md) | Thrown when a block of G-Code cannot be parsed. Details Type: [`GCodeSyntaxExceptionData`](https://software.zaber.com/motion-library/api/py/exceptions/gcodesyntaxexceptiondata.md) |
| [Ge1xGripperMovementFailedException](https://software.zaber.com/motion-library/api/py/exceptions/ge1xgrippermovementfailedexception.md) | Thrown when a movement command for a GE1x series gripper fails. |
| [IncompatibleSharedLibraryException](https://software.zaber.com/motion-library/api/py/exceptions/incompatiblesharedlibraryexception.md) | Thrown when the loaded shared library is incompatible with the running code. Typically caused by mixed library binary files. Reinstall the library. |
| [InternalErrorException](https://software.zaber.com/motion-library/api/py/exceptions/internalerrorexception.md) | Used for internal error handling. Please report an issue if observed. |
| [InvalidArgumentException](https://software.zaber.com/motion-library/api/py/exceptions/invalidargumentexception.md) | Thrown when a function is called with invalid values. |
| [InvalidCsvDataException](https://software.zaber.com/motion-library/api/py/exceptions/invalidcsvdataexception.md) | Thrown when CSV file cannot be parsed as expected. |
| [InvalidDataException](https://software.zaber.com/motion-library/api/py/exceptions/invaliddataexception.md) | Thrown when incoming device data cannot be parsed as expected. |
| [InvalidOperationException](https://software.zaber.com/motion-library/api/py/exceptions/invalidoperationexception.md) | Thrown when operation cannot be performed at given time or context. |
| [InvalidPacketException](https://software.zaber.com/motion-library/api/py/exceptions/invalidpacketexception.md) | Thrown when a packet from a device cannot be parsed. Details Type: [`InvalidPacketExceptionData`](https://software.zaber.com/motion-library/api/py/exceptions/invalidpacketexceptiondata.md) |
| [InvalidParkStateException](https://software.zaber.com/motion-library/api/py/exceptions/invalidparkstateexception.md) | Thrown when a device is unable to park. |
| [InvalidRequestDataException](https://software.zaber.com/motion-library/api/py/exceptions/invalidrequestdataexception.md) | Used for internal error handling. Indicates passing values of incorrect type from scripting languages or mixed library binary files. |
| [InvalidResponseException](https://software.zaber.com/motion-library/api/py/exceptions/invalidresponseexception.md) | Thrown when a device sends a response with unexpected type or data. Details Type: [`InvalidResponseExceptionData`](https://software.zaber.com/motion-library/api/py/exceptions/invalidresponseexceptiondata.md) |
| [IoChannelOutOfRangeException](https://software.zaber.com/motion-library/api/py/exceptions/iochanneloutofrangeexception.md) | Thrown when a device IO operation cannot be performed because the provided channel is not valid. |
| [IoFailedException](https://software.zaber.com/motion-library/api/py/exceptions/iofailedexception.md) | Thrown when the library cannot perform an operation on a file. |
| [LockstepEnabledException](https://software.zaber.com/motion-library/api/py/exceptions/lockstepenabledexception.md) | Thrown when an operation cannot be performed because lockstep motion is enabled. |
| [LockstepNotEnabledException](https://software.zaber.com/motion-library/api/py/exceptions/lockstepnotenabledexception.md) | Thrown when an operation cannot be performed because lockstep motion is not enabled. |
| [MotionLibAggregateException](https://software.zaber.com/motion-library/api/py/exceptions/motionlibaggregateexception.md) | Thrown when multiple exceptions are bundled together. |
| [MovementFailedException](https://software.zaber.com/motion-library/api/py/exceptions/movementfailedexception.md) | Thrown when a device registers a fault during movement. Details Type: [`MovementFailedExceptionData`](https://software.zaber.com/motion-library/api/py/exceptions/movementfailedexceptiondata.md) |
| [MovementInterruptedException](https://software.zaber.com/motion-library/api/py/exceptions/movementinterruptedexception.md) | Thrown when ongoing movement is interrupted by another command or user input. Details Type: [`MovementInterruptedExceptionData`](https://software.zaber.com/motion-library/api/py/exceptions/movementinterruptedexceptiondata.md) |
| [NoDeviceFoundException](https://software.zaber.com/motion-library/api/py/exceptions/nodevicefoundexception.md) | Thrown when no devices can be found on a connection. |
| [NoValueForKeyException](https://software.zaber.com/motion-library/api/py/exceptions/novalueforkeyexception.md) | Thrown when trying to access a key that has not been set. |
| [NotSupportedException](https://software.zaber.com/motion-library/api/py/exceptions/notsupportedexception.md) | Thrown when a device does not support a requested command or setting. |
| [OperationFailedException](https://software.zaber.com/motion-library/api/py/exceptions/operationfailedexception.md) | Thrown when a non-motion device fails to perform a requested operation. Details Type: [`OperationFailedExceptionData`](https://software.zaber.com/motion-library/api/py/exceptions/operationfailedexceptiondata.md) |
| [OsFailedException](https://software.zaber.com/motion-library/api/py/exceptions/osfailedexception.md) | Thrown when an operation fails due to underlying operating system error. |
| [OutOfRequestIdsException](https://software.zaber.com/motion-library/api/py/exceptions/outofrequestidsexception.md) | Thrown when the library is overwhelmed with too many simultaneous requests. |
| [PvtDiscontinuityException](https://software.zaber.com/motion-library/api/py/exceptions/pvtdiscontinuityexception.md) | Thrown when a PVT sequence encounters discontinuity and interrupts the sequence. |
| [PvtExecutionException](https://software.zaber.com/motion-library/api/py/exceptions/pvtexecutionexception.md) | Thrown when a PVT sequence motion fails. Details Type: [`PvtExecutionExceptionData`](https://software.zaber.com/motion-library/api/py/exceptions/pvtexecutionexceptiondata.md) |
| [PvtModeException](https://software.zaber.com/motion-library/api/py/exceptions/pvtmodeexception.md) | Thrown when an operation is not supported by a mode the PVT sequence is currently set up in. |
| [PvtMovementFailedException](https://software.zaber.com/motion-library/api/py/exceptions/pvtmovementfailedexception.md) | Thrown when a device registers a fault during PVT movement. Details Type: [`PvtMovementFailedExceptionData`](https://software.zaber.com/motion-library/api/py/exceptions/pvtmovementfailedexceptiondata.md) |
| [PvtMovementInterruptedException](https://software.zaber.com/motion-library/api/py/exceptions/pvtmovementinterruptedexception.md) | Thrown when ongoing PVT movement is interrupted by another command or user input. Details Type: [`PvtMovementInterruptedExceptionData`](https://software.zaber.com/motion-library/api/py/exceptions/pvtmovementinterruptedexceptiondata.md) |
| [PvtSequenceGenerationFailedException](https://software.zaber.com/motion-library/api/py/exceptions/pvtsequencegenerationfailedexception.md) | Thrown when a PVT sequence generator function fails to find a sequence. |
| [PvtSetupFailedException](https://software.zaber.com/motion-library/api/py/exceptions/pvtsetupfailedexception.md) | Thrown when setting up a PVT sequence fails. |
| [RemoteModeException](https://software.zaber.com/motion-library/api/py/exceptions/remotemodeexception.md) | Thrown when a command is rejected because the device is in EtherCAT Control (remote) mode. Change the device setting comm.ethercat.remote to 0 to switch to local control. |
| [RequestTimeoutException](https://software.zaber.com/motion-library/api/py/exceptions/requesttimeoutexception.md) | Thrown when a device does not respond to a request in time. |
| [SerialPortBusyException](https://software.zaber.com/motion-library/api/py/exceptions/serialportbusyexception.md) | Thrown when a serial port cannot be opened because it is in use by another application. |
| [SetDeviceStateFailedException](https://software.zaber.com/motion-library/api/py/exceptions/setdevicestatefailedexception.md) | Thrown when a device cannot be set to the supplied state. Details Type: [`SetDeviceStateExceptionData`](https://software.zaber.com/motion-library/api/py/exceptions/setdevicestateexceptiondata.md) |
| [SetPeripheralStateFailedException](https://software.zaber.com/motion-library/api/py/exceptions/setperipheralstatefailedexception.md) | Thrown when an axis cannot be set to the supplied state. Details Type: [`SetPeripheralStateExceptionData`](https://software.zaber.com/motion-library/api/py/exceptions/setperipheralstateexceptiondata.md) |
| [StreamDiscontinuityException](https://software.zaber.com/motion-library/api/py/exceptions/streamdiscontinuityexception.md) | Thrown when a stream encounters discontinuity and interrupts the movement. |
| [StreamExecutionException](https://software.zaber.com/motion-library/api/py/exceptions/streamexecutionexception.md) | Thrown when a streamed motion fails. Details Type: [`StreamExecutionExceptionData`](https://software.zaber.com/motion-library/api/py/exceptions/streamexecutionexceptiondata.md) |
| [StreamModeException](https://software.zaber.com/motion-library/api/py/exceptions/streammodeexception.md) | Thrown when an operation is not supported by a mode the stream is currently set up in. |
| [StreamMovementFailedException](https://software.zaber.com/motion-library/api/py/exceptions/streammovementfailedexception.md) | Thrown when a device registers a fault during streamed movement. Details Type: [`StreamMovementFailedExceptionData`](https://software.zaber.com/motion-library/api/py/exceptions/streammovementfailedexceptiondata.md) |
| [StreamMovementInterruptedException](https://software.zaber.com/motion-library/api/py/exceptions/streammovementinterruptedexception.md) | Thrown when ongoing stream movement is interrupted by another command or user input. Details Type: [`StreamMovementInterruptedExceptionData`](https://software.zaber.com/motion-library/api/py/exceptions/streammovementinterruptedexceptiondata.md) |
| [StreamSetupFailedException](https://software.zaber.com/motion-library/api/py/exceptions/streamsetupfailedexception.md) | Thrown when setting up a stream fails. |
| [TimeoutException](https://software.zaber.com/motion-library/api/py/exceptions/timeoutexception.md) | Thrown for various timeouts across the library excluding request to a device (see RequestTimeoutException). |
| [TransportAlreadyUsedException](https://software.zaber.com/motion-library/api/py/exceptions/transportalreadyusedexception.md) | Thrown when a transport has already been used to open another connection. |
| [UnknownRequestException](https://software.zaber.com/motion-library/api/py/exceptions/unknownrequestexception.md) | Used for internal error handling. Indicates mixed library binary files. Reinstall the library. |
