From a3bc05193324c6cdc456bd81acb89784b10c42c6 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Mon, 29 May 2023 16:37:07 +0000 Subject: [PATCH] fix(nix): better errors if nix-prefetch-url fails --- internal/pipe/nix/nix.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/pipe/nix/nix.go b/internal/pipe/nix/nix.go index f9d256409..6d7fa7ec0 100644 --- a/internal/pipe/nix/nix.go +++ b/internal/pipe/nix/nix.go @@ -468,5 +468,9 @@ func (p publishShaPrefetcher) Available() bool { func (p publishShaPrefetcher) Prefetch(url string) (string, error) { out, err := exec.Command(p.bin, url).Output() - return strings.TrimSpace(string(out)), err + outStr := strings.TrimSpace(string(out)) + if err != nil { + return "", fmt.Errorf("could not prefetch url: %s: %w: %s", url, err, outStr) + } + return outStr, nil }