InfluxDB: Fix returning InfluxDB error messages (#89973)

* Revert "Chore: Return influxdb query error early before parsing the result (#88549)"

This reverts commit a87c155c06.

* Handle error in buffered parser

* handle error message in streaming parser
This commit is contained in:
ismail simsek
2024-07-04 17:45:36 +02:00
committed by GitHub
parent d563db63e7
commit 4fcd348366
8 changed files with 62 additions and 11 deletions
@@ -23,6 +23,10 @@ func ResponseParse(buf io.ReadCloser, statusCode int, query *models.Query) *back
iter := jsoniter.Parse(jsoniter.ConfigDefault, buf, 1024)
r := converter.ReadInfluxQLStyleResult(iter, query)
if statusCode/100 != 2 {
return &backend.DataResponse{Error: fmt.Errorf("InfluxDB returned error: %s", r.Error)}
}
// The ExecutedQueryString can be viewed in QueryInspector in UI
for i, frame := range r.Frames {
if i == 0 {