From 2333cf3fd125fc1816579fe95fb9fc47b57782d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 13 Mar 2019 11:43:16 +0100 Subject: [PATCH] Improved error handling when rendering dashboard panels, fixes #15913 --- .../features/dashboard/containers/DashboardPage.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/public/app/features/dashboard/containers/DashboardPage.tsx b/public/app/features/dashboard/containers/DashboardPage.tsx index 1a970d3edc0..c68e24fc8e6 100644 --- a/public/app/features/dashboard/containers/DashboardPage.tsx +++ b/public/app/features/dashboard/containers/DashboardPage.tsx @@ -163,14 +163,20 @@ export class DashboardPage extends PureComponent { 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`));