File tree 1 file changed +13
-6
lines changed
src/PowerShellEditorServices.Protocol/Server
1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 15
15
using System . IO ;
16
16
using System . Linq ;
17
17
using System . Management . Automation ;
18
+ using System . Security ;
18
19
using System . Text ;
19
20
using System . Threading . Tasks ;
20
21
@@ -497,14 +498,20 @@ protected async Task HandleSetBreakpointsRequest(
497
498
scriptFile = editorSession . Workspace . GetFile ( setBreakpointsParams . Source . Path ) ;
498
499
}
499
500
}
500
- catch ( Exception e ) when ( e is FileNotFoundException || e is DirectoryNotFoundException )
501
+ catch ( Exception e ) when (
502
+ e is FileNotFoundException ||
503
+ e is DirectoryNotFoundException ||
504
+ e is IOException ||
505
+ e is NotSupportedException ||
506
+ e is PathTooLongException ||
507
+ e is SecurityException ||
508
+ e is UnauthorizedAccessException )
501
509
{
502
- Logger . Write (
503
- LogLevel . Warning ,
504
- $ "Attempted to set breakpoints on a non-existing file: { setBreakpointsParams . Source . Path } ") ;
505
-
506
- string message = this . noDebug ? string . Empty : "Source does not exist, breakpoint not set." ;
510
+ Logger . WriteException (
511
+ $ "Failed to set breakpoint on file: { setBreakpointsParams . Source . Path } ",
512
+ e ) ;
507
513
514
+ string message = this . noDebug ? string . Empty : "Source file could not be accessed, breakpoint not set - " + e . Message ;
508
515
var srcBreakpoints = setBreakpointsParams . Breakpoints
509
516
. Select ( srcBkpt => Protocol . DebugAdapter . Breakpoint . Create (
510
517
srcBkpt , setBreakpointsParams . Source . Path , message , verified : this . noDebug ) ) ;
You can’t perform that action at this time.
0 commit comments