Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rturner3
Copy link
Collaborator

@rturner3 rturner3 commented Dec 14, 2024

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.

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]>
@MarcosDY MarcosDY self-assigned this Dec 17, 2024
}
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")
Copy link
Contributor

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)
Copy link
Contributor

@sorindumitru sorindumitru Dec 26, 2024

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)
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove zeebo dependency
3 participants