From a22e1736b9596aa2a6e75ade10babd84c98ac359 Mon Sep 17 00:00:00 2001 From: Adam Shannon Date: Fri, 18 May 2018 04:20:14 -0500 Subject: [PATCH] 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 --- discovery/marathon/marathon.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/discovery/marathon/marathon.go b/discovery/marathon/marathon.go index d184b1bf5..8de42cb1b 100644 --- a/discovery/marathon/marathon.go +++ b/discovery/marathon/marathon.go @@ -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) {