discovery/marathon: include url in fetchApps error (#4171)

This was previously part of a larger PR, but that was closed.

https://github.com/prometheus/prometheus/issues/4048#issuecomment-389899997

This change could include auth information in the URL. That's been
fixed in upstream go, but not until Go 1.11. See: https://github.com/golang/go/issues/24572

Signed-off-by: Adam Shannon <adamkshannon@gmail.com>
This commit is contained in:
Adam Shannon 2018-05-18 04:20:14 -05:00 committed by Brian Brazil
parent 986674a790
commit a22e1736b9

View file

@ -344,7 +344,11 @@ func fetchApps(client *http.Client, url string) (*AppList, error) {
return nil, err
}
return parseAppJSON(body)
apps, err := parseAppJSON(body)
if err != nil {
return nil, fmt.Errorf("%v in %s", err, url)
}
return apps, nil
}
func parseAppJSON(body []byte) (*AppList, error) {