From 9be0bca3c428bebba972a0a2a42b2a3952055d6e Mon Sep 17 00:00:00 2001 From: Joo200 Date: Wed, 11 Oct 2023 17:24:35 +0200 Subject: [PATCH] Catch throwables when loading plugins (#1098) --- .../velocitypowered/proxy/plugin/VelocityPluginManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/plugin/VelocityPluginManager.java b/proxy/src/main/java/com/velocitypowered/proxy/plugin/VelocityPluginManager.java index a862a2b53..2c6f752f7 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/plugin/VelocityPluginManager.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/plugin/VelocityPluginManager.java @@ -94,7 +94,7 @@ public class VelocityPluginManager implements PluginManager { for (Path path : stream) { try { found.add(loader.loadCandidate(path)); - } catch (Exception e) { + } catch (Throwable e) { logger.error("Unable to load plugin {}", path, e); } } @@ -126,7 +126,7 @@ public class VelocityPluginManager implements PluginManager { VelocityPluginContainer container = new VelocityPluginContainer(realPlugin); pluginContainers.put(container, loader.createModule(container)); loadedPluginsById.add(realPlugin.getId()); - } catch (Exception e) { + } catch (Throwable e) { logger.error("Can't create module for plugin {}", candidate.getId(), e); } } @@ -153,7 +153,7 @@ public class VelocityPluginManager implements PluginManager { try { loader.createPlugin(container, plugin.getValue(), commonModule); - } catch (Exception e) { + } catch (Throwable e) { logger.error("Can't create plugin {}", description.getId(), e); continue; }