File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
src/PowerShellEditorServices/Workspace Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 88using System . Collections . Generic ;
99using System . Linq ;
1010using System . IO ;
11+ using System . Security ;
1112using System . Text ;
12- using System . Diagnostics ;
1313
1414namespace Microsoft . PowerShell . EditorServices
1515{
@@ -249,7 +249,19 @@ private IEnumerable<string> RecursivelyEnumerateFiles(string folderPath)
249249 RecursivelyEnumerateFiles ( dir ) ) ;
250250 }
251251 }
252- catch ( UnauthorizedAccessException e )
252+ catch ( DirectoryNotFoundException e )
253+ {
254+ this . logger . WriteException (
255+ $ "Could not enumerate files in the path '{ folderPath } ' due to it being an invalid path",
256+ e ) ;
257+ }
258+ catch ( PathTooLongException e )
259+ {
260+ this . logger . WriteException (
261+ $ "Could not enumerate files in the path '{ folderPath } ' due to the path being too long",
262+ e ) ;
263+ }
264+ catch ( Exception e ) when ( e is SecurityException || e is UnauthorizedAccessException )
253265 {
254266 this . logger . WriteException (
255267 $ "Could not enumerate files in the path '{ folderPath } ' due to the path not being accessible",
You can’t perform that action at this time.
0 commit comments