http.go: incorrect error message displayed when no metrics encoded error

The "No metrics encoded" error was erroneously displayed the value of err, not
lastErr.
This commit is contained in:
Will Rouesnel 2017-08-31 12:02:56 +10:00
parent 61d8c3f402
commit a166207919
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ func UninstrumentedHandler() 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()