Merge pull request #343 from prometheus/beorn7/http
Fix error reporting bug
This commit is contained in:
commit
967789050b
|
@ -128,7 +128,7 @@ func HandlerFor(reg prometheus.Gatherer, opts HandlerOpts) http.Handler {
|
||||||
closer.Close()
|
closer.Close()
|
||||||
}
|
}
|
||||||
if lastErr != nil && buf.Len() == 0 {
|
if lastErr != nil && buf.Len() == 0 {
|
||||||
http.Error(w, "No metrics encoded, last error:\n\n"+err.Error(), http.StatusInternalServerError)
|
http.Error(w, "No metrics encoded, last error:\n\n"+lastErr.Error(), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
header := w.Header()
|
header := w.Header()
|
||||||
|
|
Loading…
Reference in New Issue