1
0
Fork 0

Don't stomp on outer error

master
Philip O'Toole 8 months ago
parent d71c46dfa7
commit a9c9a08b6a

@ -92,18 +92,17 @@ func queryWithClient(ctx *cli.Context, client *cl.Client, timer bool, consistenc
RawQuery: queryStr.Encode(),
}
resp, err := client.Query(u)
var hcr error
resp, err := client.Query(u)
if err != nil {
// If the error is HostChangedError, it should be propagated back to the caller to handle
// accordingly (change prompt display), but we should still assume that the request succeeded on some
// host and not treat it as an error.
err, ok := err.(*cl.HostChangedError)
innerErr, ok := err.(*cl.HostChangedError)
if !ok {
return err
}
hcr = err
hcr = innerErr
}
response, err := io.ReadAll(resp.Body)

Loading…
Cancel
Save