Is there a way to enclose your entire app in a try-catch, so that if an error occurs on a user’s device, you can os.exit()? At present, if my app crashes for some reason, then even after the user closes and reopens the app, it’s still in the crashed state. The only way to fix it is to kill the process from the task bar, but not many users are aware of this.
[import]uid: 36578 topic_id: 34298 reply_id: 334298[/import]
There really isn’t a catch/try in Lua. Best bet is to fix the reason why the errors are happening, obviously. While not ideal you could have the app do an os.exit on the suspend event. Issue with that is it will exit on all suspends. [import]uid: 147305 topic_id: 34298 reply_id: 136362[/import]
The closest equivalent in Lua is the [lua]pcall()[/lua] function. Have a look at the official documentation for it here…
http://www.lua.org/pil/8.4.html
[import]uid: 32256 topic_id: 34298 reply_id: 136397[/import]
There really isn’t a catch/try in Lua. Best bet is to fix the reason why the errors are happening, obviously. While not ideal you could have the app do an os.exit on the suspend event. Issue with that is it will exit on all suspends. [import]uid: 147305 topic_id: 34298 reply_id: 136362[/import]
The closest equivalent in Lua is the [lua]pcall()[/lua] function. Have a look at the official documentation for it here…
http://www.lua.org/pil/8.4.html
[import]uid: 32256 topic_id: 34298 reply_id: 136397[/import]