Fetch exception when uninstall file could not be written

This commit is contained in:
Rene Pfeuffer
2019-09-26 16:51:26 +02:00
parent 62a0a5a127
commit ac4eca7520
3 changed files with 30 additions and 3 deletions

View File

@@ -193,9 +193,14 @@ public class DefaultPluginManager implements PluginManager {
doThrow().violation("plugin is a core plugin and cannot be uninstalled").when(installed.isCore());
dependencyTracker.removeInstalled(installed.getDescriptor());
installed.setMarkedForUninstall(true);
createMarkerFile(installed, InstalledPlugin.UNINSTALL_MARKER_FILENAME);
try {
createMarkerFile(installed, InstalledPlugin.UNINSTALL_MARKER_FILENAME);
installed.setMarkedForUninstall(true);
} catch (RuntimeException e) {
dependencyTracker.addInstalled(installed.getDescriptor());
throw e;
}
if (restartAfterInstallation) {
restart("plugin installation");