mirror of
https://github.com/prometheus/prometheus.git
synced 2025-08-06 22:27:17 +02:00
Allow unwrapping of errors when reading from remote client
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
This commit is contained in:
parent
c15140f863
commit
88bf1b1a68
@ -384,7 +384,8 @@ func (c *Client) Read(ctx context.Context, query *prompb.Query, sortSeries bool)
|
|||||||
_ = httpResp.Body.Close()
|
_ = httpResp.Body.Close()
|
||||||
|
|
||||||
cancel()
|
cancel()
|
||||||
return nil, fmt.Errorf("remote server %s returned http status %s: %s", c.urlString, httpResp.Status, string(body))
|
err := errors.New(string(body))
|
||||||
|
return nil, fmt.Errorf("remote server %s returned http status %s: %w", c.urlString, httpResp.Status, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
contentType := httpResp.Header.Get("Content-Type")
|
contentType := httpResp.Header.Get("Content-Type")
|
||||||
|
Loading…
Reference in New Issue
Block a user