|
@@ -1,4 +1,5 @@
|
|
|
import kbn from 'app/core/utils/kbn';
|
|
import kbn from 'app/core/utils/kbn';
|
|
|
|
|
+import { appEvents } from 'app/core/core';
|
|
|
import { getFlotTickDecimals } from 'app/core/utils/ticks';
|
|
import { getFlotTickDecimals } from 'app/core/utils/ticks';
|
|
|
import _ from 'lodash';
|
|
import _ from 'lodash';
|
|
|
import { getValueFormat } from '@grafana/ui';
|
|
import { getValueFormat } from '@grafana/ui';
|
|
@@ -9,8 +10,12 @@ function matchSeriesOverride(aliasOrRegex, seriesAlias) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (aliasOrRegex[0] === '/') {
|
|
if (aliasOrRegex[0] === '/') {
|
|
|
- const regex = kbn.stringToJsRegex(aliasOrRegex);
|
|
|
|
|
- return seriesAlias.match(regex) != null;
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ const regex = kbn.stringToJsRegex(aliasOrRegex);
|
|
|
|
|
+ return seriesAlias.match(regex) != null;
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ return appEvents.emit('alert-error', ['Invalid aliasOrRegex value.', e.message]);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return aliasOrRegex === seriesAlias;
|
|
return aliasOrRegex === seriesAlias;
|