Hello,
I'm trying hard to figure out a way to do proper exception handling using the DeviceClient API to connect to IoT hub.
I've been using the API for a while and still I can't get my head around the design of the callback implementation
E.g.
public void SetConnectionStatusChangesHandler(ConnectionStatusChangesHandler statusChangesHandler);
forces me to not use any async method inside the handler as I can't propagate any errors outside. A typical use case is fetching all upstream desired properties and upload reported properties after having checked for changes. But any error occuring during these functions (which are all async and therefore force me to have an async void callback) won't be fetched and basically crashes my application. All I can do is logging but that's all. What is the idea behind this design? Is there a workaround?
Thank you
Andy