Catch Exception

Determine whether a Python function call resulted in an exception.

All Python exceptions use LabVIEW error code 403427 - Python exception. However, it is sometimes useful to check for specific Python exceptions by name.

Use this VI after Call to detect a particular Python exception, identified by Exception Class Name. The output Found will be True if an Python exception with a matching name is present. A brief description of the exception is available at the Message terminal, and the complete Python stack traceback at Traceback.

If the specified exception is found, the LabVIEW error_out terminal will have "no error".

../_images/Catch.png
int32_in int32_out Session ID/Session ID Out
The current Python session ID. Session ID Out always contains the same value as Session ID.
string_in Exception Class Name
Name of the exception to check for, for example ValueError.
bool_out Found?
Whether the exception was present.
string_out Message
Brief description of the error.
string_out Traceback
String representation of the Python traceback
error_in error_out Error In/Out
Terminals for standard error functionality.

Common error codes

This VI doesn't produce any errors of its own.