external: Don't crash when another client has a lock on a jar

This commit is contained in:
Owain van Brakel
2020-02-11 03:30:09 +01:00
parent 3ac70f5fe6
commit 7742e61360

View File

@@ -209,7 +209,7 @@ class ExternalPluginManager
log.error("The following dependencies are missing: {}", deps); log.error("The following dependencies are missing: {}", deps);
for (String dep : ((DependencyResolver.DependenciesNotFoundException) ex).getDependencies()) for (String dep : deps)
{ {
install(dep); install(dep);
} }
@@ -557,6 +557,8 @@ class ExternalPluginManager
{ {
PluginInfo.PluginRelease lastRelease = updateManager.getLastPluginRelease(plugin.id); PluginInfo.PluginRelease lastRelease = updateManager.getLastPluginRelease(plugin.id);
String lastVersion = lastRelease.version; String lastVersion = lastRelease.version;
try
{
boolean updated = updateManager.updatePlugin(plugin.id, lastVersion); boolean updated = updateManager.updatePlugin(plugin.id, lastVersion);
if (!updated) if (!updated)
@@ -564,6 +566,11 @@ class ExternalPluginManager
log.warn("Cannot update plugin '{}'", plugin.id); log.warn("Cannot update plugin '{}'", plugin.id);
} }
} }
catch (PluginRuntimeException ex)
{
log.warn("Cannot update plugin '{}', the user probably has another client open", plugin.id);
}
}
} }
} }