Runtime Error Handler Not Working On Devices

Hi all,

I’ve implemented the runtime error handler a while ago following the examples provided in the documentation:

function errorHandler( event ) print("Error Handler Entered...) print( "errorHandler:", event.errorMessage, event.stackTrace ) Runtime:dispatchEvent({name='coronaView', message = 'gameError', errorMessage=event.errorMessage, stackTrace=event.stackTrace}) return true end Runtime:addEventListener( "unhandledError", errorHandler )

This code works perfectly in the simulator, print lines and all. But when running in the device, this event appears to never be called. The error line appears as per normal even without a handler, but the print line doesn’t appear in the printout and the error is not handled as intended. I found another forum post from 2013 with the same problem but no solution has been posted.

The game is running through CoronaCards, and the problem exists on both Android and iOS.

Anyone have any advice about possible reasons for this? Are there any special permissions required in the build.settings file?

Thanks for any help you can offer,
Thomas

Bump.

Any suggestions would be appreciated. Fairly stuck on this one

Thanks

Which version of Corona are you using?

v2016.2830 or 2016.2.18

Have you tried a more recent version?

I have. Tried v2016.2992 (2016.11.10) earlier, same problems occured

Hi @thomas84,

Did you read this section of the Project Configuration guide to make sure your expectations match? If so, and there’s still an issue, we can pursue it further to see if a regression bug has snuck in or something.

https://docs.coronalabs.com/guide/basics/configSettings/index.html#runtime-errors

Best regards,

Brent

Hi Brent, thanks for the response.

I have read through that document and this is what I expected. 

I’ve been trying out causing errors deliberately in different sections of the code and the error handler is actually not being triggered at all in some functions, but it is in others. There is no difference between these functions (both return true, are local, have no passed parameters etc.)
Really not sure where to go from here. 

Thanks,
Thomas

Someone on my team found the problem. It is a bug with Corona SDK where an unhandledError event is not triggered from within the listener function of a network request.

I’ve lodged a bug report.

Bump.

Any suggestions would be appreciated. Fairly stuck on this one

Thanks

Which version of Corona are you using?

v2016.2830 or 2016.2.18

Have you tried a more recent version?

I have. Tried v2016.2992 (2016.11.10) earlier, same problems occured

Hi @thomas84,

Did you read this section of the Project Configuration guide to make sure your expectations match? If so, and there’s still an issue, we can pursue it further to see if a regression bug has snuck in or something.

https://docs.coronalabs.com/guide/basics/configSettings/index.html#runtime-errors

Best regards,

Brent

Hi Brent, thanks for the response.

I have read through that document and this is what I expected. 

I’ve been trying out causing errors deliberately in different sections of the code and the error handler is actually not being triggered at all in some functions, but it is in others. There is no difference between these functions (both return true, are local, have no passed parameters etc.)
Really not sure where to go from here. 

Thanks,
Thomas

Someone on my team found the problem. It is a bug with Corona SDK where an unhandledError event is not triggered from within the listener function of a network request.

I’ve lodged a bug report.