diff --git a/prometheus/http.go b/prometheus/http.go index d485ce0..bfee5c6 100644 --- a/prometheus/http.go +++ b/prometheus/http.go @@ -96,7 +96,7 @@ func UninstrumentedHandler() http.Handler { closer.Close() } 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 } header := w.Header()