From 70ee634a80219ea3e909cda06f60bde96f3bb766 Mon Sep 17 00:00:00 2001 From: Balazs Sandor Date: Mon, 9 Sep 2024 05:23:40 +0200 Subject: [PATCH] Add http body to list handler on error (#1974) Mimic responses to that of proxy.golang.org when a list fails to produce a result. --- pkg/download/list.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/download/list.go b/pkg/download/list.go index dd94e8c92..04971cdb5 100644 --- a/pkg/download/list.go +++ b/pkg/download/list.go @@ -32,6 +32,7 @@ func ListHandler(dp Protocol, lggr log.Entry, df *mode.DownloadFile) http.Handle err = errors.E(op, err, severityLevel) lggr.SystemErr(err) w.WriteHeader(errors.Kind(err)) + _, _ = fmt.Fprintf(w, "not found: %s", strings.Replace(err.Error(), "exit status 1: go: ", "", 1)) return }