Add errorsource to InfluxDB datasource plugin fixes #1072 (#99900)

This PR adds `backend.ErrorSourceDownstream` values to all `backend.DataResponse`
values where it's certain that the error wasn't the result of the
InfluxDB datasource plugin.
This commit is contained in:
beejeebus
2025-02-04 09:33:32 -05:00
committed by GitHub
parent 1f0ff19471
commit cfae9d20d2
11 changed files with 81 additions and 9 deletions
@@ -24,7 +24,10 @@ func ResponseParse(buf io.ReadCloser, statusCode int, query *models.Query) *back
r := converter.ReadInfluxQLStyleResult(iter, query)
if statusCode/100 != 2 {
return &backend.DataResponse{Error: fmt.Errorf("InfluxDB returned error: %s", r.Error)}
return &backend.DataResponse{
Error: fmt.Errorf("InfluxDB returned error: %s", r.Error),
ErrorSource: backend.ErrorSourceFromHTTPStatus(statusCode),
}
}
// The ExecutedQueryString can be viewed in QueryInspector in UI