diff --git a/src/PowerShellEditorServices/Workspace/Workspace.cs b/src/PowerShellEditorServices/Workspace/Workspace.cs index 6f9cb8beb..d81f9f5e7 100644 --- a/src/PowerShellEditorServices/Workspace/Workspace.cs +++ b/src/PowerShellEditorServices/Workspace/Workspace.cs @@ -148,11 +148,12 @@ public bool TryGetFile(string filePath, out ScriptFile scriptFile) return true; } catch (Exception e) when ( - e is IOException || - e is SecurityException || + e is NotSupportedException || e is FileNotFoundException || e is DirectoryNotFoundException || e is PathTooLongException || + e is IOException || + e is SecurityException || e is UnauthorizedAccessException) { this.logger.WriteHandledException($"Failed to get file for {nameof(filePath)}: '{filePath}'", e);