Просмотр исходного кода

Improved error handling when rendering dashboard panels, fixes #15913

Torkel Ödegaard 6 лет назад
Родитель
Сommit
2333cf3fd1
1 измененных файлов с 9 добавлено и 3 удалено
  1. 9 3
      public/app/features/dashboard/containers/DashboardPage.tsx

+ 9 - 3
public/app/features/dashboard/containers/DashboardPage.tsx

@@ -163,14 +163,20 @@ export class DashboardPage extends PureComponent<Props, State> {
         fullscreenPanel: null,
         scrollTop: this.state.rememberScrollTop,
       },
-      () => {
-        dashboard.render();
-      }
+      this.triggerPanelsRendering.bind(this)
     );
 
     this.setPanelFullscreenClass(false);
   }
 
+  triggerPanelsRendering() {
+    try {
+      this.props.dashboard.render();
+    } catch (err) {
+      this.props.notifyApp(createErrorNotification(`Panel rendering error`, err));
+    }
+  }
+
   handleFullscreenPanelNotFound(urlPanelId: string) {
     // Panel not found
     this.props.notifyApp(createErrorNotification(`Panel with id ${urlPanelId} not found`));