fix: catch NoClassDefFoundError in order for the other expansions to be loaded (#936)

This commit is contained in:
Gabriel Dumitru 2023-03-17 22:44:41 +02:00 committed by GitHub
parent 0ae0ddc9cb
commit 81ef464dad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}
});
}