Add details message to MissingModsException and WrongMinecraftVersionException to make the Crash logs more useful.
This commit is contained in:
parent
0dc112a198
commit
229848a4cb
3 changed files with 5 additions and 3 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue