platform.registerErrorHandler

From Inspired-Lua Wiki
Revision as of 22:43, 6 June 2012 by Adriweb (talk | contribs) (Created page with "platform.'''registerErrorHandler''' is a function that is part of the platform. This function sets the error handler callback function for the script. Se...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

platform.registerErrorHandler is a function that is part of the platform.


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 quietly kills the script and prevents any error reporting to the gui.

The error handler callback function will not be called for errors that occur during initialization or within on.restore.


This has been introduced in TI-Nspire OS 3.2 (Changes).


Syntax

platform.registerErrorHandler(function(lineNumber, errorMessage, callStack, locals) ... end)

Parameter Type Description
function....
function error handler callback function

Example

platform.registerErrorHandler(function(lineNumber, errorMessage, callStack, locals) ... end)