From e86cf37242d37e994df009b17edb6f75b818478e Mon Sep 17 00:00:00 2001
From: Sylvestre Ledru <sylvestre@debian.org>
Date: Mon, 3 Jan 2022 19:41:37 +0100
Subject: [PATCH] rekor-cli: show the url in case of error (#581)

Otherwise, the error:
`
error retrieving external entities: error received while fetching artifact: 404 Not Found
`
Which isn't great for debugging

Signed-off-by: Sylvestre Ledru <sylvestre@debian.org>
---
 pkg/util/fetch.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/util/fetch.go b/pkg/util/fetch.go
index e9c95bb..f65f94a 100644
--- a/pkg/util/fetch.go
+++ b/pkg/util/fetch.go
@@ -39,7 +39,7 @@ func FileOrURLReadCloser(ctx context.Context, url string, content []byte) (io.Re
 			return nil, err
 		}
 		if resp.StatusCode < 200 || resp.StatusCode > 299 {
-			return nil, fmt.Errorf("error received while fetching artifact: %v", resp.Status)
+			return nil, fmt.Errorf("error received while fetching artifact '%v': %v", url, resp.Status)
 		}
 
 		dataReader = resp.Body
-- 
GitLab