Add details message to MissingModsException and WrongMinecraftVersionException to make the Crash logs more useful.

This commit is contained in:
Lex Manos 2014-11-08 15:13:59 -08:00
parent 0dc112a198
commit 229848a4cb
3 changed files with 5 additions and 3 deletions

View file

@ -224,7 +224,7 @@ public class Loader
{
versionMissingMods.add(names.get(modid));
}
throw new MissingModsException(versionMissingMods);
throw new MissingModsException(versionMissingMods, mod.getModId(), mod.getName());
}
reqList.putAll(mod.getModId(), names.keySet());
ImmutableList<ArtifactVersion> allDeps = ImmutableList.<ArtifactVersion>builder().addAll(mod.getDependants()).addAll(mod.getDependencies()).build();
@ -241,7 +241,7 @@ public class Loader
if (!versionMissingMods.isEmpty())
{
FMLLog.severe("The mod %s (%s) requires mod versions %s to be available", mod.getModId(), mod.getName(), versionMissingMods);
throw new MissingModsException(versionMissingMods);
throw new MissingModsException(versionMissingMods, mod.getModId(), mod.getName());
}
}

View file

@ -21,8 +21,9 @@ public class MissingModsException extends RuntimeException
private static final long serialVersionUID = 1L;
public final Set<ArtifactVersion> missingMods;
public MissingModsException(Set<ArtifactVersion> missingMods)
public MissingModsException(Set<ArtifactVersion> missingMods, String id, String name)
{
super(String.format("Mod %s (%s) requires %s", id, name, missingMods));
this.missingMods = missingMods;
}
}

View file

@ -19,6 +19,7 @@ public class WrongMinecraftVersionException extends RuntimeException
public WrongMinecraftVersionException(ModContainer mod)
{
super(String.format("Wrong Minecraft vbersion for %s", mod.getModId()));
this.mod = mod;
}