From 81ef464dad3f58f758299cbd27e2af921e0bb570 Mon Sep 17 00:00:00 2001 From: Gabriel Dumitru Date: Fri, 17 Mar 2023 22:44:41 +0200 Subject: [PATCH] fix: catch NoClassDefFoundError in order for the other expansions to be loaded (#936) --- .../expansion/manager/LocalExpansionManager.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java b/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java index c6d1ca6..80c785a 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java +++ b/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java @@ -426,12 +426,11 @@ public final class LocalExpansionManager implements Listener { } return expansionClass; - } catch (final VerifyError ex) { - Msg.severe("Failed to load expansion class %s (is a dependency missing?", file.getName() + ')'); - Msg.severe("Cause: %s %s", ex.getClass().getSimpleName(), ex.getMessage()); + } catch (VerifyError | NoClassDefFoundError e) { + Msg.severe("Failed to load expansion %s (is a dependency missing?)", e, file.getName()); return null; - } catch (final Exception ex) { - throw new CompletionException(ex); + } catch (Exception e) { + throw new CompletionException(e.getMessage() + " (expansion file: " + file.getAbsolutePath() + ")", e); } }); }