Skip to content

Commit

Permalink
Merge pull request #2047 from thaJeztah/improve_errors
Browse files Browse the repository at this point in the history
Remove duplicate "not found" from some error messages
  • Loading branch information
tonistiigi committed Jul 2, 2021
2 parents 3c4f737 + b81b56e commit f5c34a0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cache/contenthash/checksum.go
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ func (cc *cacheContext) checksum(ctx context.Context, root *iradix.Node, txn *ir
return nil, false, err
}
if cr == nil {
return nil, false, errors.Wrapf(errNotFound, "%q not found", convertKeyToPath(origk))
return nil, false, errors.Wrapf(errNotFound, "%q", convertKeyToPath(origk))
}
if cr.Digest != "" {
return cr, false, nil
Expand Down
2 changes: 1 addition & 1 deletion cache/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ func (cm *cacheManager) getRecord(ctx context.Context, id string, opts ...RefOpt

md, ok := cm.md.Get(id)
if !ok {
return nil, errors.Wrapf(errNotFound, "%s not found", id)
return nil, errors.Wrap(errNotFound, id)
}
if mutableID := getEqualMutable(md); mutableID != "" {
mutable, err := cm.getRecord(ctx, mutableID)
Expand Down
2 changes: 1 addition & 1 deletion frontend/gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ func (lbf *llbBridgeForwarder) getImmutableRef(ctx context.Context, id, path str
return nil, errors.Errorf("no such ref: %v", id)
}
if ref == nil {
return nil, errors.Wrapf(os.ErrNotExist, "%s not found", path)
return nil, errors.Wrap(os.ErrNotExist, path)
}

r, err := ref.Result(ctx)
Expand Down
2 changes: 1 addition & 1 deletion session/secrets/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func GetSecret(ctx context.Context, c session.Caller, id string) ([]byte, error)
})
if err != nil {
if code := grpcerrors.Code(err); code == codes.Unimplemented || code == codes.NotFound {
return nil, errors.Wrapf(ErrNotFound, "secret %s not found", id)
return nil, errors.Wrapf(ErrNotFound, "secret %s", id)
}
return nil, err
}
Expand Down

0 comments on commit f5c34a0

Please sign in to comment.