mirror of
https://github.com/gomods/athens
synced 2026-02-03 12:10:32 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user