diff --git a/public/app/plugins/datasource/opentsdb/datasource.ts b/public/app/plugins/datasource/opentsdb/datasource.ts index 59847c96de2..59d861b5121 100644 --- a/public/app/plugins/datasource/opentsdb/datasource.ts +++ b/public/app/plugins/datasource/opentsdb/datasource.ts @@ -1,7 +1,7 @@ import angular from 'angular'; import _ from 'lodash'; import { Observable, of } from 'rxjs'; -import { map } from 'rxjs/operators'; +import { catchError, map } from 'rxjs/operators'; import { FetchResponse, getBackendSrv } from '@grafana/runtime'; import { AnnotationEvent, @@ -84,6 +84,10 @@ export default class OpenTsDatasource extends DataSourceApi { + // 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) => { const metricToTargetMapping = this.mapMetricsToTargets(response.data, options, this.tsdbVersion); const result = _.map(response.data, (metricData: any, index: number) => {