Template vars: Add error message for failed query var (#21731)

This commit is contained in:
Tobias Skarhed 2020-01-24 15:55:36 +01:00 committed by GitHub
parent 39f7cff7c7
commit 4c41d7e7fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,9 +11,10 @@ import { TimeSrv } from 'app/features/dashboard/services/TimeSrv';
import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { DashboardModel } from 'app/features/dashboard/state/DashboardModel';
// Types // Types
import { TimeRange } from '@grafana/data'; import { TimeRange, AppEvents } from '@grafana/data';
import { CoreEvents } from 'app/types'; import { CoreEvents } from 'app/types';
import { UrlQueryMap } from '@grafana/runtime'; import { UrlQueryMap } from '@grafana/runtime';
import { appEvents } from 'app/core/core';
export class VariableSrv { export class VariableSrv {
dashboard: DashboardModel; dashboard: DashboardModel;
@ -71,9 +72,14 @@ export class VariableSrv {
}); });
}); });
return this.$q.all(promises).then(() => { return this.$q
this.dashboard.startRefresh(); .all(promises)
}); .then(() => {
this.dashboard.startRefresh();
})
.catch(e => {
appEvents.emit(AppEvents.alertError, ['Template variable service failed', e.message]);
});
} }
processVariable(variable: any, queryParams: any) { processVariable(variable: any, queryParams: any) {