I get an ERA message about an “unhandled exception” crash extremely rarely, but every now and then. I have been using the app myself for a year and have never had this crash. No user has ever contacted me so I could ask what they are doing...
The crash happens with the query “if (gearArt > 0)” where “gearArt” is a number and is read from the settings. Only 0, 1 or 2 may be entered there.
I have now written a few lines of check code to work around the error. The question is: can try/catch handle an “unhandled exception” at all?
Do you have any ideas?
Thanks a lot!
// following checks due to (extremly rare) crashs reportet by ERA for: if (gearArt > 0) { --> unhandled exception // gearArt is read from Settings, and can actually only be 0, 1, or 2! if ( gearArt == null ) { gearArt = 0; } gearArt = gearArt.toNumber(); try { if (gearArt > 0) { // just try } } catch (e) { gearArt = 0; } // End check if (gearArt > 0) { // this line triggers the extremly rare crash (unhandled exception) var errFlag = 0; if (gearArt == 1) {