azure-iot-sdk-rs
azure-iot-sdk-rs copied to clipboard
Better error handling
Handle errors with iot hub error type and communicate issues back to main program
I think I was about to open a duplicate issue. Does this refer to making network operations return results instead of panicking?
e.g.
https://github.com/damienpontifex/azure-iot-sdk-rs/blob/e30a9ad2d8b10264f230d96d78ee8ffea216dfb3/src/mqtt_transport.rs#L201-L215
A panic on line 202 indicates a downstream user's failure to use the library correctly or a bug in the topic name building logic, so should continue to panic, but line 214 could fail due to a network issue and should propagate the result in an error type defined by this library.
Just clarifying as I will probably take a stab at this.
Do you want to preserve the existing API and add a new API that returns results or are you thinking just breaking the API by replacing it?
Exactly @rubberduck203 - make things like network errors that should be recoverable/retryable or to reconnect surface to the developer at least.
Current version is still 0.x so I'm happy introducing breaking changes to the API :)