From 6ad70f7b94fea1daf0bdd9e49ee69c0b4c0a5088 Mon Sep 17 00:00:00 2001 From: Sylwester Piskozub Date: Tue, 3 Feb 2026 15:22:31 +0100 Subject: [PATCH 1/2] improve error message Signed-off-by: Sylwester Piskozub --- app/controlplane/pkg/data/referrer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controlplane/pkg/data/referrer.go b/app/controlplane/pkg/data/referrer.go index 4565e006b..d9d72ea44 100644 --- a/app/controlplane/pkg/data/referrer.go +++ b/app/controlplane/pkg/data/referrer.go @@ -1,5 +1,5 @@ // -// Copyright 2023 The Chainloop Authors. +// Copyright 2023-2026 The Chainloop Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -89,10 +89,10 @@ func (r *ReferrerRepo) Save(ctx context.Context, referrers []*biz.Referrer, work // Iterate on the items it refer to (references) var references []uuid.UUID for _, ref := range parentRef.References { - // amd find it in the DB + // and find it in the DB storedReference, ok := storedMap[ref.MapID()] if !ok { - return fmt.Errorf("referrer %v not found", ref) + return fmt.Errorf("an artifact or piece of evidence with digest %s (kind: %s) can't be found", ref.Digest, ref.Kind) } references = append(references, storedReference) From 0fe4ae56bba0917431c226f0d847527b746f1f5d Mon Sep 17 00:00:00 2001 From: Sylwester Piskozub Date: Wed, 4 Feb 2026 14:09:30 +0100 Subject: [PATCH 2/2] fix error msg Signed-off-by: Sylwester Piskozub --- app/controlplane/pkg/biz/referrer.go | 4 ++-- app/controlplane/pkg/data/referrer.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controlplane/pkg/biz/referrer.go b/app/controlplane/pkg/biz/referrer.go index f82829df1..3caa97e9b 100644 --- a/app/controlplane/pkg/biz/referrer.go +++ b/app/controlplane/pkg/biz/referrer.go @@ -213,7 +213,7 @@ func (s *ReferrerUseCase) GetFromRoot(ctx context.Context, digest, rootKind stri return nil, fmt.Errorf("getting referrer from root: %w", err) } else if ref == nil { - return nil, NewErrNotFound("referrer") + return nil, NewErrNotFound(fmt.Sprintf("artifact or piece of evidence with digest %s", digest)) } return ref, nil @@ -251,7 +251,7 @@ func (s *ReferrerUseCase) GetFromRootInPublicSharedIndex(ctx context.Context, di return nil, fmt.Errorf("getting referrer from root: %w", err) } else if ref == nil { - return nil, NewErrNotFound("referrer") + return nil, NewErrNotFound(fmt.Sprintf("artifact or piece of evidence with digest %s", digest)) } return ref, nil diff --git a/app/controlplane/pkg/data/referrer.go b/app/controlplane/pkg/data/referrer.go index d9d72ea44..4565e006b 100644 --- a/app/controlplane/pkg/data/referrer.go +++ b/app/controlplane/pkg/data/referrer.go @@ -1,5 +1,5 @@ // -// Copyright 2023-2026 The Chainloop Authors. +// Copyright 2023 The Chainloop Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -89,10 +89,10 @@ func (r *ReferrerRepo) Save(ctx context.Context, referrers []*biz.Referrer, work // Iterate on the items it refer to (references) var references []uuid.UUID for _, ref := range parentRef.References { - // and find it in the DB + // amd find it in the DB storedReference, ok := storedMap[ref.MapID()] if !ok { - return fmt.Errorf("an artifact or piece of evidence with digest %s (kind: %s) can't be found", ref.Digest, ref.Kind) + return fmt.Errorf("referrer %v not found", ref) } references = append(references, storedReference)