After developing two games using corona and many learned lessons, I still have a lack of understanding of Corona’s error handling. I’m working on a business type app (not as fun as making games) and I come across runtime errors that crash the app. I have had a hard time catching those errors, in fact the only method that I know to catch an error is the user-unfriendly pcall(methodName, “error string”).
I’m a C# .net developer and I love the try catch blocks, exception hierarchy as well as bubbling up error messages. Now I realize there are big differences between Lua and C# but is there somewhere I can meet in the middle? I have defensive code in my functions to try to prevent the errors but unless I’m running the simulator, I have no idea what my runtime errors are on my device. There are no error logs on the device (when viewed in xCode organizer).
Is there a way that I can “catch” all runtime errors and access the actual message at the beginning of my app and display them either to the app screen (beta) and eventually a device error log? The errors that appear in the simulator when a runtime error occurs would be fine. If not, what other error handling techniques have you found useful?
I have also found that runtime errors that occur on my device do not happen on the simulator, which is quite annoying.
I’d love to do something like this:
try
{
StartApp()
}
catch(Exception ex)
{
HandleException(ex) – either displays to screen or records to an error log
}
Thanks,
Rob [import]uid: 38348 topic_id: 31674 reply_id: 331674[/import]
[import]uid: 52491 topic_id: 31674 reply_id: 126809[/import]