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,11 +557,18 @@ class ExternalPluginManager
{ {
PluginInfo.PluginRelease lastRelease = updateManager.getLastPluginRelease(plugin.id); PluginInfo.PluginRelease lastRelease = updateManager.getLastPluginRelease(plugin.id);
String lastVersion = lastRelease.version; String lastVersion = lastRelease.version;
boolean updated = updateManager.updatePlugin(plugin.id, lastVersion); try
if (!updated)
{ {
log.warn("Cannot update plugin '{}'", plugin.id); boolean updated = updateManager.updatePlugin(plugin.id, lastVersion);
if (!updated)
{
log.warn("Cannot update plugin '{}'", plugin.id);
}
}
catch (PluginRuntimeException ex)
{
log.warn("Cannot update plugin '{}', the user probably has another client open", plugin.id);
} }
} }
} }