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
Hi all! First, I want to thank you for listening to the community and adding WithReturnConnectionError, it's really useful!
I have an idea how we can make it even better. Currently, the connection error's type is lost and only the error's text is used:
Hi all! First, I want to thank you for listening to the community and adding
WithReturnConnectionError
, it's really useful!I have an idea how we can make it even better. Currently, the connection error's type is lost and only the error's text is used:
At the end we have an error from type
errors.errorString
and the only way to check the underlying error is string comparison, which is unreliable.Use case(s) - what problem will this feature solve?
Proposed Solution
%w
modifier, which wraps the error. Later, that error can be unwrapped witherrors.Unwrap
:However, from what I see in go.mod, the minimum supported go version is 1.11 and that's a problem, because above features were added in 1.13
errors.Unwrap
can be used directly;Sorry for the pseudo code, if that idea is approved, I can do a better version.
The text was updated successfully, but these errors were encountered: