mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
OpenTSDB: Fix showing error on query (#32421)
This commit is contained in:
parent
bc2d90f140
commit
a220e5dac2
@ -1,7 +1,7 @@
|
|||||||
import angular from 'angular';
|
import angular from 'angular';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { Observable, of } from 'rxjs';
|
import { Observable, of } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import { catchError, map } from 'rxjs/operators';
|
||||||
import { FetchResponse, getBackendSrv } from '@grafana/runtime';
|
import { FetchResponse, getBackendSrv } from '@grafana/runtime';
|
||||||
import {
|
import {
|
||||||
AnnotationEvent,
|
AnnotationEvent,
|
||||||
@ -84,6 +84,10 @@ export default class OpenTsDatasource extends DataSourceApi<OpenTsdbQuery, OpenT
|
|||||||
});
|
});
|
||||||
|
|
||||||
return this.performTimeSeriesQuery(queries, start, end).pipe(
|
return this.performTimeSeriesQuery(queries, start, end).pipe(
|
||||||
|
catchError((err) => {
|
||||||
|
// Throw the error message here instead of the whole object to workaround the error parsing error.
|
||||||
|
throw err?.data?.error?.message || 'Error performing time series query.';
|
||||||
|
}),
|
||||||
map((response) => {
|
map((response) => {
|
||||||
const metricToTargetMapping = this.mapMetricsToTargets(response.data, options, this.tsdbVersion);
|
const metricToTargetMapping = this.mapMetricsToTargets(response.data, options, this.tsdbVersion);
|
||||||
const result = _.map(response.data, (metricData: any, index: number) => {
|
const result = _.map(response.data, (metricData: any, index: number) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user