Skip to content

Commit

Permalink
Template vars: Add error message for failed query var (#21731)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Skarhed committed Jan 24, 2020
1 parent 39f7cff commit 4c41d7e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions public/app/features/templating/variable_srv.ts
Expand Up @@ -11,9 +11,10 @@ import { TimeSrv } from 'app/features/dashboard/services/TimeSrv';
import { DashboardModel } from 'app/features/dashboard/state/DashboardModel';

// Types
import { TimeRange } from '@grafana/data';
import { TimeRange, AppEvents } from '@grafana/data';
import { CoreEvents } from 'app/types';
import { UrlQueryMap } from '@grafana/runtime';
import { appEvents } from 'app/core/core';

export class VariableSrv {
dashboard: DashboardModel;
Expand Down Expand Up @@ -71,9 +72,14 @@ export class VariableSrv {
});
});

return this.$q.all(promises).then(() => {
this.dashboard.startRefresh();
});
return this.$q
.all(promises)
.then(() => {
this.dashboard.startRefresh();
})
.catch(e => {
appEvents.emit(AppEvents.alertError, ['Template variable service failed', e.message]);
});
}

processVariable(variable: any, queryParams: any) {
Expand Down

0 comments on commit 4c41d7e

Please sign in to comment.