Browse Source

Refactoring of PR #14772

Torkel Ödegaard 6 years ago
parent
commit
878da68c90
2 changed files with 3 additions and 7 deletions
  1. 2 2
      public/app/core/specs/kbn.test.ts
  2. 1 5
      public/app/plugins/panel/graph/module.ts

+ 2 - 2
public/app/core/specs/kbn.test.ts

@@ -2,12 +2,12 @@ import kbn from '../utils/kbn';
 
 describe('stringToJsRegex', () => {
   it('should parse the valid regex value', () => {
-    const output = kbn.stringToJsRegex("/validRegexp/");
+    const output = kbn.stringToJsRegex('/validRegexp/');
     expect(output).toBeInstanceOf(RegExp);
   });
 
   it('should throw error on invalid regex value', () => {
-    const input = "/etc/hostname";
+    const input = '/etc/hostname';
     expect(() => {
       kbn.stringToJsRegex(input);
     }).toThrow();

+ 1 - 5
public/app/plugins/panel/graph/module.ts

@@ -235,11 +235,7 @@ class GraphCtrl extends MetricsPanelCtrl {
     }
 
     for (const series of this.seriesList) {
-      try {
-        series.applySeriesOverrides(this.panel.seriesOverrides);
-      } catch (e) {
-        this.publishAppEvent('alert-error', [e.message]);
-      }
+      series.applySeriesOverrides(this.panel.seriesOverrides);
 
       if (series.unit) {
         this.panel.yaxes[series.yaxis - 1].format = series.unit;