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
1 changed files with 4 additions and 5 deletions

View File

@ -426,12 +426,11 @@ public final class LocalExpansionManager implements Listener {
} }
return expansionClass; return expansionClass;
} catch (final VerifyError ex) { } catch (VerifyError | NoClassDefFoundError e) {
Msg.severe("Failed to load expansion class %s (is a dependency missing?", file.getName() + ')'); Msg.severe("Failed to load expansion %s (is a dependency missing?)", e, file.getName());
Msg.severe("Cause: %s %s", ex.getClass().getSimpleName(), ex.getMessage());
return null; return null;
} catch (final Exception ex) { } catch (Exception e) {
throw new CompletionException(ex); throw new CompletionException(e.getMessage() + " (expansion file: " + file.getAbsolutePath() + ")", e);
} }
}); });
} }