Commit 9485c678 by Dominik Prokop

Fix plugin loading failure message not being displayed

parent 8f6ccce1
...@@ -68,7 +68,7 @@ export class DashboardPanel extends PureComponent<Props, State> { ...@@ -68,7 +68,7 @@ export class DashboardPanel extends PureComponent<Props, State> {
// handle plugin loading & changing of plugin type // handle plugin loading & changing of plugin type
if (!this.state.plugin || this.state.plugin.id !== pluginId) { if (!this.state.plugin || this.state.plugin.id !== pluginId) {
const plugin = config.panels[pluginId] || getPanelPluginNotFound(pluginId); let plugin = config.panels[pluginId] || getPanelPluginNotFound(pluginId);
// remember if this is from an angular panel // remember if this is from an angular panel
const fromAngularPanel = this.state.angularPanel != null; const fromAngularPanel = this.state.angularPanel != null;
...@@ -81,10 +81,15 @@ export class DashboardPanel extends PureComponent<Props, State> { ...@@ -81,10 +81,15 @@ export class DashboardPanel extends PureComponent<Props, State> {
} }
if (plugin.exports) { if (plugin.exports) {
this.setState({ plugin: plugin, angularPanel: null }); this.setState({ plugin, angularPanel: null });
} else { } else {
plugin.exports = await importPluginModule(plugin.module); try {
this.setState({ plugin: plugin, angularPanel: null }); plugin.exports = await importPluginModule(plugin.module);
} catch (e) {
plugin = getPanelPluginNotFound(pluginId);
}
this.setState({ plugin, angularPanel: null });
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment