Update forgePatches with better exception printing

This commit is contained in:
Raven Szewczyk committed 2023-02-18 17:43:37 +00:00
1 parent c622d3f346
commit f21364cd3d
3 files changed
+14 -2

No files matched your search

+2 -2
View File
@@ -1,4 +1,4 @@
//version: 1676031737
//version: 1676679815
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
@@ -677,7 +677,7 @@ dependencies {
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
}
if (modId != 'hodgepodge') {
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.0.31')
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.0.35')
}
java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false}
@@ -114,6 +114,7 @@ public class ClassPatchManager {
inputData = patcher.patch(inputData, patch.patch);
} catch (IOException e) {
FMLRelaunchLog.log(Level.ERROR, e, "Encountered problem runtime patching class %s", name);
e.printStackTrace();
continue;
}
}
@@ -127,6 +128,7 @@ public class ClassPatchManager {
Files.write(inputData, new File(tempDir, mappedName));
} catch (IOException e) {
FMLRelaunchLog.log(Level.ERROR, e, "Failed to write %s to %s", mappedName, tempDir.getAbsolutePath());
e.printStackTrace();
}
}
patchedClasses.put(name, inputData);
@@ -156,6 +158,7 @@ public class ClassPatchManager {
jis = new JarInputStream(new ByteArrayInputStream(jarBytes.toByteArray()));
} catch (Exception e) {
FMLRelaunchLog.log(Level.ERROR, e, "Error occurred reading binary patches. Expect severe problems!");
e.printStackTrace();
throw Throwables.propagate(e);
}
@@ -189,6 +192,7 @@ public class ClassPatchManager {
input = ByteStreams.newDataInput(ByteStreams.toByteArray(jis));
} catch (IOException e) {
FMLRelaunchLog.log(Level.WARN, e, "Unable to read binpatch file %s - ignoring", patchEntry.getName());
e.printStackTrace();
return null;
}
String name = input.readUTF();
@@ -173,6 +173,7 @@ public class CoreModManager {
Level.ERROR,
e,
"The patch transformer failed to load! This is critical, loading cannot continue!");
e.printStackTrace();
throw Throwables.propagate(e);
}
@@ -300,6 +301,7 @@ public class CoreModManager {
mfAttributes = jar.getManifest().getMainAttributes();
} catch (IOException ioe) {
FMLRelaunchLog.log(Level.ERROR, ioe, "Unable to read the jar file %s - ignoring", coreMod.getName());
ioe.printStackTrace();
continue;
} finally {
if (jar != null) {
@@ -363,6 +365,7 @@ public class CoreModManager {
}
} catch (MalformedURLException e) {
FMLRelaunchLog.log(Level.ERROR, e, "Unable to convert file into a URL. weird");
e.printStackTrace();
continue;
}
loadCoreMod(classLoader, fmlCorePlugin, coreMod);
@@ -416,6 +419,7 @@ public class CoreModManager {
e,
"There was a problem trying to load the mod dir tweaker %s",
coreMod.getAbsolutePath());
e.printStackTrace();
}
}
@@ -526,6 +530,7 @@ public class CoreModManager {
"Coremod %s: The plugin %s is not an implementor of IFMLLoadingPlugin",
coreModName,
coreModClass);
cce.printStackTrace();
} catch (InstantiationException ie) {
FMLRelaunchLog.log(
Level.ERROR,
@@ -533,6 +538,7 @@ public class CoreModManager {
"Coremod %s: The plugin class %s was not instantiable",
coreModName,
coreModClass);
ie.printStackTrace();
} catch (IllegalAccessException iae) {
FMLRelaunchLog.log(
Level.ERROR,
@@ -540,6 +546,7 @@ public class CoreModManager {
"Coremod %s: The plugin class %s was not accessible",
coreModName,
coreModClass);
iae.printStackTrace();
}
return null;
}
@@ -571,6 +578,7 @@ public class CoreModManager {
FMLRelaunchLog.fine("Sorted coremod list %s", loadPlugins);
} catch (Exception e) {
FMLLog.log(Level.ERROR, e, "There was a problem performing the coremod sort");
e.printStackTrace();
throw Throwables.propagate(e);
}
}