vmctl: check error in response from influxdb (#5446)

This commit is contained in:
wozz 2023-12-11 09:24:08 -05:00 committed by GitHub
parent e13dc04fbf
commit 27668c9d01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -360,6 +360,9 @@ func (c *Client) do(q influx.Query) ([]queryValues, error) {
if err != nil {
return nil, fmt.Errorf("query %q err: %s", q.Command, err)
}
if res.Error() != nil {
return nil, fmt.Errorf("query %q err: %s", q.Command, res.Error())
}
if len(res.Results) < 1 {
return nil, fmt.Errorf("exploration query %q returned 0 results", q.Command)
}