Improve logging for failures during plugin installation

This commit is contained in:
René Pfeuffer
2020-11-24 18:18:16 +01:00
parent 5d42444835
commit b67a0cb89d

View File

@@ -192,10 +192,16 @@ public class DefaultPluginManager implements PluginManager {
dependencyTracker.addInstalled(plugin.getDescriptor()); dependencyTracker.addInstalled(plugin.getDescriptor());
pendingInstallations.add(pending); pendingInstallations.add(pending);
eventBus.post(new PluginEvent(PluginEvent.PluginEventType.INSTALLED, plugin)); eventBus.post(new PluginEvent(PluginEvent.PluginEventType.INSTALLED, plugin));
} catch (PluginInstallException ex) { } catch (PluginInstallException installException) {
try {
cancelPending(pendingInstallations); cancelPending(pendingInstallations);
} catch (PluginFailedToCancelInstallationException cancelInstallationException) {
LOG.error("could not install plugin {}; uninstallation failed (see next exception)", plugin.getDescriptor().getInformation().getName(), installException);
throw cancelInstallationException;
} finally {
eventBus.post(new PluginEvent(PluginEvent.PluginEventType.INSTALLATION_FAILED, plugin)); eventBus.post(new PluginEvent(PluginEvent.PluginEventType.INSTALLATION_FAILED, plugin));
throw ex; }
throw installException;
} }
} }