platform.registerErrorHandler(function(lineNumber, errorMessage,
callStack, locals) ... end)
This function sets the error handler callback function for the script. Setting an error handler callback function provides control over what happens when an error is encountered in the script. Returning a true value prevents reporting the Error to the user. The script will continue executing on the next event.
Note
The error handler callback function is not called for errors that occur during initialization or within on.restore.
Introduced in platform.apiLevel = '2.0'