Fix broken target scrape error propagation.

This commit is contained in:
Julius Volz 2013-02-21 19:48:54 +01:00
parent 3537edee9f
commit 5d55785936
1 changed files with 2 additions and 1 deletions

View File

@ -138,7 +138,8 @@ func (t *target) Scrape(earliest time.Time, results chan format.Result) (err err
done <- true
}()
resp, err := http.Get(t.Address())
var resp *http.Response // Don't shadow "err" from the enclosing function.
resp, err = http.Get(t.Address())
if err != nil {
return
}