Skip to content

Commit

Permalink
fix(metadb): wrong error message in PatchDB() implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
  • Loading branch information
andaaron committed Jan 13, 2025
1 parent 1170016 commit 5db6f8e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ var (
ErrMissingAuthHeader = errors.New("required authorization header is missing")
ErrUserAPIKeyNotFound = errors.New("user info for given API key hash not found")
ErrUserSessionNotFound = errors.New("user session for given ID not found")
ErrInvalidMetaDBVersion = errors.New("unrecognized version meta")
ErrBucketDoesNotExist = errors.New("bucket does not exist")
ErrOpenIDProviderDoesNotExist = errors.New("openid provider does not exist in given config")
ErrHashKeyNotCreated = errors.New("cookiestore generated random hash key is nil, aborting")
Expand Down
2 changes: 1 addition & 1 deletion pkg/meta/boltdb/boltdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -1569,7 +1569,7 @@ func (bdw *BoltDB) PatchDB() error {
}

if version.GetVersionIndex(DBVersion) == -1 {
return fmt.Errorf("DB has broken format, no version found %w", err)
return fmt.Errorf("%w: %s could not identify patches", zerr.ErrInvalidMetaDBVersion, DBVersion)
}

for patchIndex, patch := range bdw.Patches {
Expand Down
2 changes: 1 addition & 1 deletion pkg/meta/dynamodb/dynamodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -2055,7 +2055,7 @@ func (dwr *DynamoDB) PatchDB() error {
}

if version.GetVersionIndex(DBVersion) == -1 {
return fmt.Errorf("DB has broken format, no version found %w", err)
return fmt.Errorf("%w: %s could not identify patches", zerr.ErrInvalidMetaDBVersion, DBVersion)
}

for patchIndex, patch := range dwr.Patches {
Expand Down

0 comments on commit 5db6f8e

Please sign in to comment.