Better mod crash logs

This commit is contained in:
Anuken
2019-10-11 16:08:14 -04:00
parent b927c2df1a
commit 4e0d1b2746
7 changed files with 87 additions and 21 deletions

View File

@ -23,6 +23,7 @@ import io.anuke.mindustry.desktop.steam.*;
import io.anuke.mindustry.game.EventType.*;
import io.anuke.mindustry.game.Version;
import io.anuke.mindustry.maps.Map;
import io.anuke.mindustry.mod.Mods.*;
import io.anuke.mindustry.net.*;
import io.anuke.mindustry.net.Net.*;
import io.anuke.mindustry.ui.*;
@ -229,7 +230,10 @@ public class DesktopLauncher extends ClientLauncher{
boolean fbgp = badGPU;
CrashSender.send(e, file -> {
Throwable cause = Strings.getFinalCause(e);
Array<Throwable> causes = Strings.getCauses(e);
Throwable fc = causes.find(t -> t instanceof ModLoadException);
if(fc == null) fc = Strings.getFinalCause(e);
Throwable cause = fc;
if(!fbgp){
dialog.accept(() -> message("A crash has occured. It has been saved in:\n" + file.getAbsolutePath() + "\n" + cause.getClass().getSimpleName().replace("Exception", "") + (cause.getMessage() == null ? "" : ":\n" + cause.getMessage())));
}