Crash reporting fixes

This commit is contained in:
Anuken 2018-11-17 12:25:38 -05:00
parent afec65eb56
commit bab8120814

View File

@ -85,7 +85,7 @@ public class CrashHandler{
try{ try{
Path path = Paths.get(OS.getAppDataDirectoryString(Vars.appName), "crashes", Path path = Paths.get(OS.getAppDataDirectoryString(Vars.appName), "crashes",
"crash-report-" + DateTimeFormatter.ofPattern("MM-dd-yyyy-HH:mm:ss").format(LocalDateTime.now()) + ".txt"); "crash-report-" + DateTimeFormatter.ofPattern("MM dd yyyy HH mm ss").format(LocalDateTime.now()) + ".txt");
Files.createDirectories(Paths.get(OS.getAppDataDirectoryString(Vars.appName), "crashes")); Files.createDirectories(Paths.get(OS.getAppDataDirectoryString(Vars.appName), "crashes"));
Files.write(path, parseException(e).getBytes()); Files.write(path, parseException(e).getBytes());
@ -117,7 +117,7 @@ public class CrashHandler{
StringWriter sw = new StringWriter(); StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw); PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw); e.printStackTrace(pw);
return sw.toString().replace(e.getMessage(), e.getMessage().replace(System.getProperty("user.name"), "[USERNAME]")); return sw.toString();
} }
private static void ex(Runnable r){ private static void ex(Runnable r){