Error Name: Unhandled Exception Occurrences: 97 First Occurrence: 2024-02-05 Last Occurrence: 2024-02-18 Devices: Venu® 3: 8.25 App Versions: 2.3.2 Languages: deu, eng, heb Backtrace: MySensor.open:74 MySensor.setAntId:61 MyApp.onStartImpl:113 MyApp.onStart:85
class MySensor extends Ant.GenericChannel { public function initialize() { try { Ant.GenericChannel.initialize(method(:onMessage), new Ant.ChannelAssignment( Ant.CHANNEL_TYPE_RX_NOT_TX, // Bidirectional Receive (Slave) Ant.NETWORK_PLUS) ); } catch (e instanceof Ant.UnableToAcquireChannelException) { errorRelease("" + e.getErrorMessage()); searching = -1; // Maybe this is causing the problem } data = new ExtHRMData(); deviceCfg = newDeviceConfig(); } public function open() as Boolean { data.reset(); if (searching != -1) { searching = deviceCfg.deviceNumber; } // try { GenericChannel.setDeviceConfig(deviceCfg); // this is line 74 // } catch (e) { // errorRelease("deviceCfg: " + searching + "; " + e.getErrorMessage()); // } // Open the channel return GenericChannel.open(); } ... }
The above code is producing the errors. I am about to add the try / catch in open(), but I don't feel like it will do any good. I mean I might get less errors in ERA (maybe I'll need to move the
GenericChannel.open() to the try as well) but the user experience won't be better. Maybe even worse. They open the app. Now it crashes, after adding the try it probably won't, but it still won't connect to the HRM... And even though I "log" the exception, it's not that I can get that information (so far no user contacted me)
My guess is that some people managed to save incorrect antId in the settings OR that they actually already got an exception in initialize, which I do catch, but it means that the UnableToAcquireChannelException left the channel unconfigured I guess, so that can also cause this.
I've never been able to reproduce any of these myself.
What should/can I do? Keep it crash? Add try/catches "to clean up ERA"? Is there anything I could do to improve the situation?