How to detect error when app is running on the phone.

So if an error occurs on the simulator, the simulation will stop and ask to restart it.

Now on a phone, if the error occurs, I am going to guess that the app will freeze (not sure about this.)

If an error does occur, the user would not know about it.

So, is there a way where if an error occurs; the user will be prompted a message saying there is an error?

native.showAlert() works

the documentation to the corona api is your friend

https://coronalabs.com/blog/2013/03/06/run-time-error-handling/

Also, if you’re actually concerned about debugging on-device:

https://docs.coronalabs.com/guide/basics/debugging/index.html

Ah thanks guys!

I looked it up but I didnt get anything at that time.

I don’t understand what you mean.

You can always wrap in a pcall() to stop errors crashing your app.  You will to check the response to ascertain if the pcall trapped an error or not.

native.showAlert() works

the documentation to the corona api is your friend

https://coronalabs.com/blog/2013/03/06/run-time-error-handling/

Also, if you’re actually concerned about debugging on-device:

https://docs.coronalabs.com/guide/basics/debugging/index.html

Ah thanks guys!

I looked it up but I didnt get anything at that time.

I don’t understand what you mean.

You can always wrap in a pcall() to stop errors crashing your app.  You will to check the response to ascertain if the pcall trapped an error or not.