-
Notifications
You must be signed in to change notification settings - Fork 485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove github.com/zeebo/errs dependency #5716
base: main
Are you sure you want to change the base?
Conversation
We don't really use this dependency for much other than to group some errors together with a common error message prefix. The same can now be accomplished with a couple custom error types and the `errors` standard library package. This package also wasn't consistently adopted throughout the project, so at this point it's probably better to just rely on the standard library functionality, since it's sufficient for the project's use cases. Signed-off-by: Ryan Turner <[email protected]>
Signed-off-by: Ryan Turner <[email protected]>
} | ||
if c.JWTIssuer != "" { | ||
jwtIssuer, err := url.Parse(c.JWTIssuer) | ||
if err != nil || jwtIssuer.Scheme == "" || jwtIssuer.Host == "" { | ||
return nil, errs.New("the jwt_issuer url could not be parsed") | ||
return nil, errors.New("the jwt_issuer url could not be parsed") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we also include the error in here and maybe the jwtIssuer?
@@ -300,7 +300,7 @@ func migrateDB(db *gorm.DB, dbType string, disableMigration bool, log logrus.Fie | |||
dbCodeVersion, err := getDBCodeVersion(*migration) | |||
if err != nil { | |||
log.WithError(err).Error("Error getting DB code version") | |||
return sqlError.New("error getting DB code version: %v", err) | |||
return newSQLError("error getting DB code version: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this be better in any way with newWrappedSQLError(fmt.Errorf("error getting DB code version: %w", err))
? I think it might be better for use with errors.Is
.
@@ -250,6 +250,7 @@ func (s *PluginSuite) TestBundleCRUD() { | |||
|
|||
// fetch non-existent | |||
fb, err := s.ds.FetchBundle(ctx, "spiffe://foo") | |||
s.T().Logf("err type: %T", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a debug leftover?
We don't really use this dependency for much other than to group some errors together with a common error message prefix. The same can now be accomplished with a couple custom error types and the
errors
standard library package.This package also wasn't consistently adopted throughout the project, so at this point it's probably better to just rely on the standard library functionality, since it's sufficient for the project's use cases.
Fixes #5631.