fix(graphite): minor fix/improvement to graphite error handling when doing metric exploration in query editor, fixes #5778

This commit is contained in:
Torkel Ödegaard
2016-08-11 10:29:28 +02:00
parent 780ec92dd8
commit 0d26bc63ae
2 changed files with 15 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ import moment from 'moment';
import gfunc from './gfunc';
import {Parser} from './parser';
import {QueryCtrl} from 'app/plugins/sdk';
import appEvents from 'app/core/app_events';
export class GraphiteQueryCtrl extends QueryCtrl {
static templateUrl = 'partials/query.editor.html';
@@ -141,7 +142,7 @@ export class GraphiteQueryCtrl extends QueryCtrl {
}
}
}).catch(err => {
this.error = err.message || 'Failed to issue metric query';
appEvents.emit('alert-error', ['Error', err]);
});
}
@@ -178,7 +179,7 @@ export class GraphiteQueryCtrl extends QueryCtrl {
altSegments.unshift(this.uiSegmentSrv.newSegment('*'));
return altSegments;
}).catch(err => {
this.error = err.message || 'Failed to issue metric query';
appEvents.emit('alert-error', ['Error', err]);
return [];
});
}