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
@@ -105,3 +105,11 @@ func TestParsingAsTimeSeriesWithoutTimeColumn(t *testing.T) {
runQuery(t, f, "cardinality", "time_series", query)
})
}
func TestInfluxDBStreamingParser(t *testing.T) {
t.Run("Influxdb response parser with error message", func(t *testing.T) {
result := ResponseParse(readJsonFile("invalid_response"), 400, generateQuery("Test raw query", "time_series", ""))
require.Nil(t, result.Frames)
require.EqualError(t, result.Error, "InfluxDB returned error: failed to parse query: found WERE, expected ; at line 1, char 38")
})
}