Hi Corona staff
I log every error in my live app to a database and I am getting a large number of errors that are almost useless for debugging purposes… This is by far the most common error (below).
This gets logged at least 5,000 times a day but only from around 1% of active devices. How am I supposed to localise the error on players’ devices when this is all I get as a stack trace?
To give you and idea of the (needle in a haystack) issue, reCalculateStatistics() is some 500 lines long that time slices over 10 frames (via a runtime enter frame event). It recalculates 20+ runtime parameters for each tile over 100x100 tiles.
Without a line number to localise the error to how do I know what instruction is raising the error?
bad argument #1 to ? (number expected, got nil)
stack traceback:
[C]: in function ?
?: in function reCalculateStatistics
?: in function func
/Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:222: in function </Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:205>
Also, players are saying that the game randomly crashes and I don’t understand why this happens when I have the following
Runtime:addEventListener( “unhandledError”, unhandledErrorListener)
that is supposed to catch and handle all errors? The function is as follows and all that does is log the error to Google Analytics, log the error to my server and return true
function unhandledErrorListener( event )
ga.error(event.errorMessage, fatal)
local errorString = event.errorMessage…"\n"…event.stackTrace
gameEngine:logError(errorString)
return true
end
Is there something I am missing? Shouldn’t this function mean that no unhandled error will ever stop the app crashing? Because players are reporting the app just immediately stops and exits back to their home screen.
FYI, one device logged over 800 errors, I replicated their game on simulator (using their device id) and was unable to raise a single error so this is definitely something that is device dependent.
If there is anything else I can do then please advise what this might be. Upsetting paying players is not high on my list of things to do.
I have over 10,000 DAU so I would really appreciate some insight into how I can localise these errors.
Kind regards
Adrian