Compare commits

...

3 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
64d21a9899 Improve error logging message with more context
Co-authored-by: khmyznikov <6115884+khmyznikov@users.noreply.github.com>
2025-10-15 21:03:38 +00:00
copilot-swe-agent[bot]
c47e334718 Add error handling to MainViewModel constructor to prevent XAML instantiation failures
Co-authored-by: khmyznikov <6115884+khmyznikov@users.noreply.github.com>
2025-10-15 21:00:03 +00:00
copilot-swe-agent[bot]
c5144b6f3a Initial plan 2025-10-15 20:53:49 +00:00

View File

@@ -79,8 +79,17 @@ namespace PowerToys.FileLocksmithUI.ViewModels
public MainViewModel()
{
paths = NativeMethods.ReadPathsFromFile();
Logger.LogInfo($"Starting FileLocksmith with {paths.Length} files selected.");
try
{
paths = NativeMethods.ReadPathsFromFile();
Logger.LogInfo($"Starting FileLocksmith with {paths.Length} files selected.");
}
catch (Exception ex)
{
Logger.LogError("Failed to read paths from the FileLocksmith temporary file during initialization. FileLocksmith will start with an empty file list.", ex);
paths = Array.Empty<string>();
}
LoadProcessesCommand = new AsyncRelayCommand(LoadProcessesAsync);
}