Type Event Dispatch chain ▸ Runtime Revision 2017.3060 Keywords unhandledError, runtime
These events occur when an application experiences a runtime error. They are only dispatched to the global Runtime object.
If true
is returned from the listener for "unhandledError"
, the error is suppressed and application execution will continue. Returning false
(or nothing) from the listener will allow the runtime error to be reported to the user and the application to terminate.
local unhandledErrorListener = function( event ) print( "We have a problem: " .. event.errorMessage ) end Runtime:addEventListener( "unhandledError", unhandledErrorListener )
function errorHandler( event ) print( event.errorMessage, event.stackTrace ) end Runtime:addEventListener( "unhandledError", errorHandler )