Fix error reporting bug
That's the same bug fixed in #342 (which is the deprecated code only replicated in the `prometheus` package until v0.10 is out).
This commit is contained in:
parent
535f493f5a
commit
2cb8df16e3
|
@ -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