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

(cherry picked from commit 27668c9d01)
This commit is contained in:
wozz 2023-12-11 09:24:08 -05:00 committed by hagen1778
parent 73f843a70e
commit 61f940591f
No known key found for this signature in database
GPG Key ID: 3BF75F3741CA9640

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)
}