Skip to content

Commit f496f9e

Browse files
authored
Catch any exception during EBS injection (#253)
For some reason EBS injection only caught and rethrew with more details CNFEs, this PR widens it to all exceptions (like exceptions caused by the dist cleaner)
1 parent 05f882f commit f496f9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

loader/src/main/java/net/neoforged/fml/javafmlmod/AutomaticEventSubscriber.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ public static void inject(final ModContainer mod, final ModFileScanData scanData
5959

6060
bus.register(Class.forName(ad.clazz().getClassName(), true, layer.getClassLoader()));
6161
}
62-
} catch (ClassNotFoundException e) {
63-
LOGGER.fatal(LOADING, "Failed to load mod class {} for @EventBusSubscriber annotation", ad.clazz(), e);
62+
} catch (Exception e) {
63+
LOGGER.fatal(LOADING, "Failed to register class {} with @EventBusSubscriber annotation", ad.clazz(), e);
6464
throw new RuntimeException(e);
6565
}
6666
}

0 commit comments

Comments
 (0)