The Logic 2 Automation Interface will return errors in certain situations. These errors fall into two main categories:

  1. Errors produced by misuse of the API. These errors will contained detailed information about exactly why the command failed, and in some cases, list out what parameter was invalid, as well as the valid options. Be sure to read each error message closely! If these errors occur in production, it may mean there are still bugs in your code. These should not be handled in code.

  2. Occasional errors while recording due to USB connectivity problems. These are rare errors, but they can occur at random - like if another USB device consumes a spike of bandwidth, causing the logic analyzer stream buffer to overflow, stopping the capture. We recommend that the developer handle these errors, and restart the capture as appropriate.

You will want to catch CaptureError errors raised by start_capture, stop, and wait. If an error occurs during the capture start process, then start_capture will raise an error. If an error occurs during the capture, for example if the software wasn’t able to receive data over USB fast enough, then the capture will end prematurely. However, the python client won’t be aware of this until stop or wait is called, at which point CaptureError will be raised.

If any of these commands raise the CaptureError exception, we recommend simply starting a new capture. if stop or wait raise the error, be sure to dispose of the capture before starting the next one.

class saleae.automation.SaleaeError

The base class for all Saleae exceptions. Do not catch this directly.

class saleae.automation.UnknownError

This indicates that the error message from the Logic 2 software was not understood by the python library. This could indicate a version mismatch.

class saleae.automation.InternalServerError

An unexpected error occurred in the Logic 2 software. Please submit these errors to Saleae support.

class saleae.automation.InvalidRequestError

The socket request was invalid. See exception message for details.

class saleae.automation.LoadCaptureFailedError

Error loading a saved capture. This could indicate that the file does not exist, or the file was saved with a newer version of the Logic 2 software, or that the file was not a valid saved file. Try manually loading the file in the Logic 2 software for more information.

class saleae.automation.ExportError

An error occurred either while exporting raw data, a single protocol analyzer, or the protocol analyzer data table. Check the exception message for more details.

class saleae.automation.MissingDeviceError

The device ID supplied to the start_capture function is not currently attached to the system, or it has not been detected by the software. For general support for device not detected errors, see this support article:

class saleae.automation.CaptureError

The base class for all capture related errors. We recommend all automation applications handle this exception type. Capture failures occur rarely, and for a handful of reasons. We recommend logging the exception message for later troubleshooting. We do not recommend attempting to access or save captures that end in an error. Instead, we recommend starting a new capture. Check the exception message for details.

class saleae.automation.DeviceError

This error represents any device related error while capturing. USB communication or bandwidth errors, missing calibration, device disconnection while recording, and more. Check the exception message for details.

class saleae.automation.OutOfMemoryError

This exception indicates that the capture was automatically terminated because the capture buffer was filled.