Ok, so this line of code is from the method of a makeWebRequest running in the background process (from onTemporalEvent) and it generates a Unhandled Exception for someone (one watch model, 44 times).
timestamp = timestamp + "|" + Application.loadResource(Rez.Strings.label_launch_widget);
label_launch_widget is defined like this
<string id="label_launch_widget" scope="background">Launch widget</string>
timestamp is set from this try/catch code and it isn't touched until that line above that asserts
var timestamp; try { var clock_time = System.getClockTime(); var hours = clock_time.hour; var minutes = clock_time.min.format("%02d"); var suffix = ""; if (System.getDeviceSettings().is24Hour == false) { suffix = "am"; if (hours == 0) { hours = 12; } else if (hours > 12) { suffix = "pm"; hours -= 12; } } timestamp = " @ " + hours + ":" + minutes + suffix; } catch (e) { timestamp = ""; }
So timestamp is either an empty string (not null) or a time of day string.
Both the label and the timestamp is used elsewhere, and even there without any issue on my watch and simulator, so why can it create an Unhandled Exception? Could it be because of the watch model? It's a Descent Mk2 S: V8.70 according to ERA. Watch language is in Korean according to ERA but it's not in the resource files, so I'm assuming it defaults to English?