Skip to content

Commit

Permalink
Don't add code late at night
Browse files Browse the repository at this point in the history
  • Loading branch information
sm6srw committed Jan 18, 2024
1 parent 2f20563 commit 3cc4adb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/DynamoCoreWpf/Utilities/CrashReportTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,44 +200,44 @@ 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");
}
}

if (args.SendSettingsFile && model != null)
{
string settingsFile = Path.Combine(cerDir.FullName, "DynamoSettings.xml");

if (File.Exists(settingsFile))
if (File.Exists(model.PathManager.PreferenceFilePath))
{
File.Copy(model.PathManager.PreferenceFilePath, settingsFile);

filesToSend.Add(settingsFile);
}
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}");
}
}

Expand Down

0 comments on commit 3cc4adb

Please sign in to comment.