Skip to content

Commit 8e22bc0

Browse files
committed
Include influxdb query in error message
Signed-off-by: Matt Lord <[email protected]>
1 parent f998537 commit 8e22bc0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

go/storage/influxdb/influxdb.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ package influxdb
2121
import (
2222
"context"
2323
"fmt"
24+
2425
influxdb2 "github.com/influxdata/influxdb-client-go/v2"
2526
)
2627

@@ -45,10 +46,10 @@ func (c *Client) Select(query string) ([]map[string]interface{}, error) {
4546
result = append(result, queryResult.Record().Values())
4647
}
4748
if queryResult.Err() != nil {
48-
return result, fmt.Errorf("Query error: %s\n", queryResult.Err().Error())
49+
return result, fmt.Errorf("Error execution query %q: %v\n", query, queryResult.Err())
4950
}
5051
} else {
51-
return result, fmt.Errorf("Query error: %s\n", err.Error())
52+
return result, fmt.Errorf("Error execution query %q: %v\n", query, err)
5253
}
5354
return result, nil
5455
}

0 commit comments

Comments
 (0)