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
Over the years I've had several reports about wanting to differentiate error types.
When I initially started developing this module, the state of error reporting in Go was still kind of meh, fmt.Errorf didn't exist, errors.Join didn't exist, etc. Opaque errors were recommended but I did not want to keep adding new error types or values ad infinitum, so I went the route of using (now deprecated) github.com/pkg/errors, which subsequently got replaced by fmt.Errorf
But now that I'm preparing to release v3, I believe the codebase is more or less stable and I can safely add error types/values as needed, and the required tooling now exist in Go itself.
General approach:
Deprecate all IsXXXXError, use errors.Is
Use specific error types (b/c I like it that way)
Use utility function to wrap errors
The text was updated successfully, but these errors were encountered:
Over the years I've had several reports about wanting to differentiate error types.
When I initially started developing this module, the state of error reporting in Go was still kind of meh,
fmt.Errorf
didn't exist,errors.Join
didn't exist, etc. Opaque errors were recommended but I did not want to keep adding new error types or values ad infinitum, so I went the route of using (now deprecated)github.com/pkg/errors
, which subsequently got replaced byfmt.Errorf
But now that I'm preparing to release
v3
, I believe the codebase is more or less stable and I can safely add error types/values as needed, and the required tooling now exist in Go itself.General approach:
IsXXXXError
, useerrors.Is
The text was updated successfully, but these errors were encountered: