More crash reporting tweaks. Don't crash when trying to show warnings. Also, put the exception name in the error screen on the second line!
Signed-off-by: cpw <cpw+github@weeksfamily.ca>
This commit is contained in:
parent
c382527ba2
commit
9f3141ea16
2 changed files with 4 additions and 4 deletions
|
@ -59,7 +59,7 @@ public class ForgeI18n {
|
|||
customFactories.put("lower", (name, formatString, locale) -> new CustomReadOnlyFormat((stringBuffer, objectToParse) -> stringBuffer.append(StringUtils.toLowerCase(String.valueOf(objectToParse)))));
|
||||
// {0,upper> -> uppercase supplied string
|
||||
customFactories.put("upper", (name, formatString, locale) -> new CustomReadOnlyFormat((stringBuffer, objectToParse) -> stringBuffer.append(StringUtils.toUpperCase(String.valueOf(objectToParse)))));
|
||||
// {0,exc,class} -> class of exception; {0,exc,msg} -> message from exception
|
||||
// {0,exc,cls} -> class of exception; {0,exc,msg} -> message from exception
|
||||
customFactories.put("exc", (name, formatString, locale) -> new CustomReadOnlyFormat((stringBuffer, objectToParse) -> parseException(formatString, stringBuffer, objectToParse)));
|
||||
// {0,vr} -> transform VersionRange into cleartext string using fml.messages.version.restriction.* strings
|
||||
customFactories.put("vr", (name, formatString, locale) -> new CustomReadOnlyFormat(((stringBuffer, o) -> MavenVersionStringHelper.parseVersionRange(formatString, stringBuffer, o))));
|
||||
|
@ -72,9 +72,9 @@ public class ForgeI18n {
|
|||
private static void parseException(final String formatString, final StringBuffer stringBuffer, final Object objectToParse) {
|
||||
Throwable t = (Throwable) objectToParse;
|
||||
if (Objects.equals(formatString, "msg")) {
|
||||
stringBuffer.append(t.getMessage());
|
||||
stringBuffer.append(t.getClass().getName()).append(": ").append(t.getMessage());
|
||||
} else if (Objects.equals(formatString, "cls")) {
|
||||
stringBuffer.append(t.getClass());
|
||||
stringBuffer.append(t.getClass().getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ public class LoadingErrorScreen extends ErrorScreen {
|
|||
this.modLoadErrors = loadingException == null ? Collections.emptyList() : loadingException.getErrors();
|
||||
this.modsDir = FMLPaths.MODSDIR.get();
|
||||
this.logFile = FMLPaths.GAMEDIR.get().resolve(Paths.get("logs","latest.log"));
|
||||
this.dumpedLocation = dumpedLocation.toPath();
|
||||
this.dumpedLocation = dumpedLocation != null ? dumpedLocation.toPath() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue