Skip to content

Error handling

Method errors

If your Python method contains throws errors when executing, the $methoderror callback is called with a row parameter which contains two columns:

errorCode column contains the error code of the error.

errorInfo column contains information about the error.

You can use the errorCode and errorInfo columns to debug your Python method.

Worker errors

If the Python Worker has failed to start, the $workererror callback is called with a row parameter which contains two columns:

errorCode column contains the error code of the error.

errorInfo column contains information about the error.

These errors are unlikely to be caused by the method called, but more likely issues with Python itself e.g. quitting due to missing packages.

Registering callbacks

If you inherited your Python Worker, you can simply override callbacks in your new object.

Otherwise, if you created a new variable with the object type of OW3 Python Worker, you will need to register the instance that will receive the callbacks such as $methoderror, $workererror and $methodreturn.

You can do so by assigning the instance to the $callbackinst property, for example:

Do pyWorker.$callbackinst.$assign($cinst)

Will assign the callback instance to $cinst (current instance). If $cinst is a window, then that window class must implement the methods $methoderror, $workererror and $methodreturn.

Methods and properties

To view all methods and properties of the OW3 Python Worker, please consult the online documentation available here.