File tree 1 file changed +14
-2
lines changed
src/PowerShellEditorServices/Workspace
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 8
8
using System . Collections . Generic ;
9
9
using System . Linq ;
10
10
using System . IO ;
11
+ using System . Security ;
11
12
using System . Text ;
12
- using System . Diagnostics ;
13
13
14
14
namespace Microsoft . PowerShell . EditorServices
15
15
{
@@ -249,7 +249,19 @@ private IEnumerable<string> RecursivelyEnumerateFiles(string folderPath)
249
249
RecursivelyEnumerateFiles ( dir ) ) ;
250
250
}
251
251
}
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 )
253
265
{
254
266
this . logger . WriteException (
255
267
$ "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