Crash fix + drill balance

This commit is contained in:
Anuken
2019-06-19 21:41:49 -04:00
parent 47b1e700ea
commit 8e95be0ac2
4 changed files with 20 additions and 18 deletions
@@ -50,6 +50,17 @@ public class CrashSender{
}
}
try{
File file = new File(OS.getAppDataDirectoryString(Vars.appName), "crashes/crash-report-" + DateTimeFormatter.ofPattern("MM_dd_yyyy_HH_mm_ss").format(LocalDateTime.now()) + ".txt");
new File(OS.getAppDataDirectoryString(Vars.appName)).mkdir();
new BufferedOutputStream(new FileOutputStream(file), Streams.DEFAULT_BUFFER_SIZE).write(parseException(exception).getBytes());
Files.createDirectories(Paths.get(OS.getAppDataDirectoryString(Vars.appName), "crashes"));
writeListener.accept(file);
}catch(Throwable ignored){
Log.err("Failed to save local crash report.");
}
try{
//check crash report setting
if(!Core.settings.getBool("crashreport", true)){
@@ -64,17 +75,6 @@ public class CrashSender{
return;
}
try{
File file = new File(OS.getAppDataDirectoryString(Vars.appName), "crashes/crash-report-" + DateTimeFormatter.ofPattern("MM_dd_yyyy_HH_mm_ss").format(LocalDateTime.now()) + ".txt");
new File(OS.getAppDataDirectoryString(Vars.appName)).mkdir();
new BufferedOutputStream(new FileOutputStream(file), Streams.DEFAULT_BUFFER_SIZE).write(parseException(exception).getBytes());
Files.createDirectories(Paths.get(OS.getAppDataDirectoryString(Vars.appName), "crashes"));
writeListener.accept(file);
}catch(Throwable ignored){
Log.err("Failed to save local crash report.");
}
boolean netActive = false, netServer = false;
//attempt to close connections, if applicable