From 3cc4adba06f1d21780f68fccf50fceb7ba3f380a Mon Sep 17 00:00:00 2001 From: Jorgen Dahl Date: Thu, 18 Jan 2024 08:33:10 -0500 Subject: [PATCH] Don't add code late at night --- src/DynamoCoreWpf/Utilities/CrashReportTool.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/DynamoCoreWpf/Utilities/CrashReportTool.cs b/src/DynamoCoreWpf/Utilities/CrashReportTool.cs index ab23e98b9f5..a44e2062d67 100644 --- a/src/DynamoCoreWpf/Utilities/CrashReportTool.cs +++ b/src/DynamoCoreWpf/Utilities/CrashReportTool.cs @@ -200,14 +200,14 @@ internal static bool ShowCrashErrorReportWindow(DynamoViewModel viewModel, Crash { string logFile = Path.Combine(cerDir.FullName, "DynamoLog.log"); - if(File.Exists(logFile)) + if(File.Exists(model.Logger.LogPath)) { File.Copy(model.Logger.LogPath, logFile); filesToSend.Add(logFile); } else { - model?.Logger?.LogError($"Failed to add DynamoLog.log to CER with the following error : {logFile} Not Found"); + model?.Logger?.LogError($"Failed to add DynamoLog.log to CER with the following error : {model.Logger.LogPath} Not Found"); } } @@ -215,7 +215,7 @@ internal static bool ShowCrashErrorReportWindow(DynamoViewModel viewModel, Crash { string settingsFile = Path.Combine(cerDir.FullName, "DynamoSettings.xml"); - if (File.Exists(settingsFile)) + if (File.Exists(model.PathManager.PreferenceFilePath)) { File.Copy(model.PathManager.PreferenceFilePath, settingsFile); @@ -223,21 +223,21 @@ internal static bool ShowCrashErrorReportWindow(DynamoViewModel viewModel, Crash } else { - model?.Logger?.LogError($"Failed to add DynamoSettings.xml to CER with the following error : {settingsFile} Not Found"); + model?.Logger?.LogError($"Failed to add DynamoSettings.xml to CER with the following error : {model.PathManager.PreferenceFilePath} Not Found"); } } if (args.HasDetails()) { var stackTracePath = Path.Combine(cerDir.FullName, "StackTrace.log"); - if(File.Exists(stackTracePath)) + try { File.WriteAllText(stackTracePath, args.Details); filesToSend.Add(stackTracePath); } - else + catch (Exception ex) { - model?.Logger?.LogError($"Failed to add StackTrace.log to CER with the following error : {stackTracePath} Not Found "); + model?.Logger?.LogError($"Failed to add StackTrace.log to CER with the following error : {ex.Message}"); } }