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.
This commit is contained in:
Balazs Sandor
2024-09-09 05:23:40 +02:00
committed by GitHub
parent 34002b8408
commit 70ee634a80
+1
View File
@@ -32,6 +32,7 @@ func ListHandler(dp Protocol, lggr log.Entry, df *mode.DownloadFile) http.Handle
err = errors.E(op, err, severityLevel) err = errors.E(op, err, severityLevel)
lggr.SystemErr(err) lggr.SystemErr(err)
w.WriteHeader(errors.Kind(err)) w.WriteHeader(errors.Kind(err))
_, _ = fmt.Fprintf(w, "not found: %s", strings.Replace(err.Error(), "exit status 1: go: ", "", 1))
return return
} }