Skip to content

Commit b44bf4e

Browse files
committed
Added error handling around result export
Added error handling around result export
1 parent 8d08b24 commit b44bf4e

File tree

1 file changed

+8
-1
lines changed
  • Harden-Windows-Security Module/Main files/C#/GUI/Confirm

1 file changed

+8
-1
lines changed

Harden-Windows-Security Module/Main files/C#/GUI/Confirm/View.cs

+8-1
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,14 @@ await Task.Run(() =>
319319
// Get the selected file path from the dialog
320320
string filePath = saveFileDialog.FileName;
321321

322-
ExportSecOpsToCsv(filePath, SecOpsObservableCollection);
322+
try
323+
{
324+
ExportSecOpsToCsv(filePath, SecOpsObservableCollection);
325+
}
326+
catch (Exception ex)
327+
{
328+
Logger.LogMessage($"Failed to export the results to the file: {ex.Message}", LogTypeIntel.ErrorInteractionRequired);
329+
}
323330

324331
Logger.LogMessage($"Compliance check results have been successfully exported.", LogTypeIntel.InformationInteractionRequired);
325332
}

0 commit comments

Comments
 (0)