mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: fixes throwing errors on 200 response with influxdb datasource (#24848)
* Chore: fixes throwing errors on 200 response with influxdb datasource * Chore: changes influxdb error prefix from error to influxdb error
This commit is contained in:
@@ -322,6 +322,15 @@ export default class InfluxDatasource extends DataSourceApi<InfluxQuery, InfluxO
|
||||
.datasourceRequest(req)
|
||||
.then(
|
||||
(result: any) => {
|
||||
if (result.data && result.data.results) {
|
||||
const errors = result.data.results.filter((elem: any) => elem.error);
|
||||
if (errors.length > 0) {
|
||||
throw {
|
||||
message: 'InfluxDB Error: ' + errors[0].error,
|
||||
data: result.data,
|
||||
};
|
||||
}
|
||||
}
|
||||
return result.data;
|
||||
},
|
||||
(err: any) => {
|
||||
|
||||
Reference in New Issue
Block a user