Skip to content

Commit a9005d8

Browse files
rkeithhillTylerLeonhardt
authored andcommitted
Catch NotSupportedException which can be thrown by FilleStream ctor (#866)
The 7 exceptions that are caught now are doc'd in: https://docs.microsoft.com/en-us/dotnet/api/system.io.filestream.-ctor?view=netframework-4.7.2#System_IO_FileStream__ctor_System_String_System_IO_FileMode_System_IO_FileAccess_
1 parent d6bd5b1 commit a9005d8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/PowerShellEditorServices/Workspace/Workspace.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,12 @@ public bool TryGetFile(string filePath, out ScriptFile scriptFile)
148148
return true;
149149
}
150150
catch (Exception e) when (
151-
e is IOException ||
152-
e is SecurityException ||
151+
e is NotSupportedException ||
153152
e is FileNotFoundException ||
154153
e is DirectoryNotFoundException ||
155154
e is PathTooLongException ||
155+
e is IOException ||
156+
e is SecurityException ||
156157
e is UnauthorizedAccessException)
157158
{
158159
this.logger.WriteHandledException($"Failed to get file for {nameof(filePath)}: '{filePath}'", e);

0 commit comments

Comments
 (0)