You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
proposal: add new err parameter to connectHandler #443
The current connectHandler has the following signature:
func(deviceDevice, connectedbool)
In case of connection failure or unexpected disconnection, we only have the connected boolean value. But more information can be exposed through an error object.
After a quick experimentation I was able to retrieve the following disconnection error message: The connection has timed out unexpectedly. from the underlying stack, and I think this is really worth the change.
My proposal, is to update the connect handler with an error parameter:
changed the title [-]proposal: add new `err error` parameter to `connectHandler`[/-][+]proposal: add new `err` parameter to `connectHandler`[/+]on Apr 26, 2026
I didn't yet go into consideration wether breaking change is justified here, but regardless, if it is decided to make the change, maybe consider making it a bit more future proof by using a struct that can have both connected status and error value instead of separate arguments.
Activity
[-]Report disconnection reason[/-][+]proposal: add new `err error` parameter to `connectHandler`[/+][-]proposal: add new `err error` parameter to `connectHandler`[/-][+]proposal: add new `err` parameter to `connectHandler`[/+]HattoriHanzo031 commentedon Apr 29, 2026
I didn't yet go into consideration wether breaking change is justified here, but regardless, if it is decided to make the change, maybe consider making it a bit more future proof by using a struct that can have both connected status and error value instead of separate arguments.