chore: use typed error and fix missing wraps

This commit is contained in:
CrazyMax
2023-09-16 11:01:31 +02:00
parent 20681d68d1
commit 24bc0548e0
24 changed files with 109 additions and 94 deletions

View File

@@ -7,6 +7,7 @@ import (
"github.com/containers/image/v5/docker/reference"
"github.com/crazy-max/diun/v4/pb"
"github.com/pkg/errors"
"google.golang.org/protobuf/types/known/timestamppb"
)
@@ -55,7 +56,7 @@ func (c *Client) ImageInspect(ctx context.Context, request *pb.ImageInspectReque
}
if _, ok := images[ref.Name()]; !ok {
return nil, fmt.Errorf("%s not found in database", ref.Name())
return nil, errors.Errorf("%s not found in database", ref.Name())
}
iir := &pb.ImageInspectResponse_Image{