@@ -29,12 +29,14 @@ import (
2929 "github.com/google/go-containerregistry/pkg/v1/empty"
3030 "github.com/google/go-containerregistry/pkg/v1/mutate"
3131 "github.com/google/go-containerregistry/pkg/v1/remote"
32+ "github.com/google/go-containerregistry/pkg/v1/remote/transport"
3233 "github.com/google/go-containerregistry/pkg/v1/static"
3334 "github.com/google/go-containerregistry/pkg/v1/types"
3435
3536 ocispec "github.com/opencontainers/image-spec/specs-go/v1"
3637
3738 pb "github.com/chainloop-dev/chainloop/app/artifact-cas/api/cas/v1"
39+ backend "github.com/chainloop-dev/chainloop/internal/blobmanager"
3840)
3941
4042type Backend struct {
@@ -185,6 +187,11 @@ func (b *Backend) Describe(_ context.Context, digest string) (*pb.CASResource, e
185187
186188 img , err := remote .Image (ref , remote .WithAuthFromKeychain (b .keychain ))
187189 if err != nil {
190+ var e * transport.Error
191+ if errors .As (err , & e ) && e .StatusCode == http .StatusNotFound {
192+ return nil , backend .NewErrNotFound ("image" )
193+ }
194+
188195 return nil , fmt .Errorf ("getting image: %w" , err )
189196 }
190197
@@ -197,7 +204,7 @@ func (b *Backend) Describe(_ context.Context, digest string) (*pb.CASResource, e
197204 return nil , fmt .Errorf ("extracting manifest: %w" , err )
198205 }
199206
200- // Valirate image already checked that the manifest has exactly one layer
207+ // Validate image already checked that the manifest has exactly one layer
201208 size := manifest .Layers [0 ].Size
202209
203210 filename , ok := manifest .Annotations [ocispec .AnnotationTitle ]
0 commit comments