From ad8e9f10c3fdcafda49422dd042ae7b74304b359 Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 9 Jun 2012 11:07:07 -0400 Subject: [PATCH] Fix up "errored" mod states so they actually read as errors --- fml/common/cpw/mods/fml/common/Loader.java | 19 +++++++++++++++---- .../cpw/mods/fml/common/LoaderException.java | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/fml/common/cpw/mods/fml/common/Loader.java b/fml/common/cpw/mods/fml/common/Loader.java index 69f833336..4f58f0146 100644 --- a/fml/common/cpw/mods/fml/common/Loader.java +++ b/fml/common/cpw/mods/fml/common/Loader.java @@ -468,10 +468,20 @@ public class Loader continue; } String clazzName=path+fname.group(2); - log.fine(String.format("Found a mod class %s in directory %s, attempting to load it", clazzName, modDir.getName())); - loadModClass(modDir, file.getName(), clazzName, sourceType); - log.fine(String.format("Successfully loaded mod class %s", file.getName())); - foundAModClass = true; + try + { + log.fine(String.format("Found a mod class %s in directory %s, attempting to load it", clazzName, modDir.getName())); + loadModClass(modDir, file.getName(), clazzName, sourceType); + log.fine(String.format("Successfully loaded mod class %s", file.getName())); + foundAModClass = true; + } + catch (Exception e) + { + log.severe(String.format("File %s failed to read properly", file.getName())); + log.throwing("fml.server.Loader", "attemptDirLoad", e); + state = State.ERRORED; + capturedError = e; + } } return foundAModClass; @@ -514,6 +524,7 @@ public class Loader { log.warning(String.format("Failed to load mod class %s in %s", classFileName, classSource.getAbsoluteFile())); log.throwing("fml.server.Loader", "attemptLoad", e); + throw new LoaderException(e); } } diff --git a/fml/common/cpw/mods/fml/common/LoaderException.java b/fml/common/cpw/mods/fml/common/LoaderException.java index 1dfc9e86f..29f5c66b1 100644 --- a/fml/common/cpw/mods/fml/common/LoaderException.java +++ b/fml/common/cpw/mods/fml/common/LoaderException.java @@ -20,7 +20,7 @@ public class LoaderException extends RuntimeException */ private static final long serialVersionUID = -5675297950958861378L; - public LoaderException(Exception wrapped) + public LoaderException(Throwable wrapped) { super(wrapped); }