Define a callback function to catch thrown errors messages.
Example - Catch JS Errors
function OnStart()
{
app.SetOnError( OnError );
throw "My thrown error";
}
function OnError( msg, line, file )
{
var text =
'Message: "' + msg + '"\n' +
'Line: ' + line + '\n' +
'File: "' + app.Uri2Path(file) + '"';
app.Alert( text, "Received error message:" );
}
from native import app
def OnStart():
app.SetOnError(OnError)
raise Exception("My thrown error")
def OnError(msg):
text = 'Message: "' + msg + '"\n' +
'Line: ' + str(line) + '\n' +
'File: "' + app.Uri2Path(file) + '"'
app.Alert(text, "Received error message:")