Add exception logging to class patching failure
@@ -159,6 +159,7 @@ public class EntryLoader {
for (Map.Entry<String, byte[]> e : invalidClasses.entrySet()) {
String entryName = e.getKey();
byte[] value = e.getValue();
+ try {
// Attempt to patch invalid classes.
// If the internal measure fails, allow plugins to patch invalid classes
if (!ClassUtil.isValidClass(value)) {
@@ -182,9 +183,13 @@ public class EntryLoader {
debug("Illegal class patching success!");
handleAddClass(entryName, value);
} else {
- warn("Invalid class \"{}\" - Cannot be parsed with ASM reader\nAdding as a file instead.", entryName);
+ warn("Invalid class \"{}\" - Cannot be parsed with ASM reader\n" +
+ "Adding as a file instead.", entryName);
onFile(entryName, value);
}
+ } catch (Throwable t) {
+ error(t, "Failed to patch invalid class due to patcher crash \"{}\"", entryName);
+ }
}
}
