File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
src/PowerShellEditorServices.Protocol/Server Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 1515using System . IO ;
1616using System . Linq ;
1717using System . Management . Automation ;
18+ using System . Security ;
1819using System . Text ;
1920using System . Threading . Tasks ;
2021
@@ -497,14 +498,20 @@ protected async Task HandleSetBreakpointsRequest(
497498 scriptFile = editorSession . Workspace . GetFile ( setBreakpointsParams . Source . Path ) ;
498499 }
499500 }
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 )
501509 {
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 ) ;
507513
514+ string message = this . noDebug ? string . Empty : "Source file could not be accessed, breakpoint not set - " + e . Message ;
508515 var srcBreakpoints = setBreakpointsParams . Breakpoints
509516 . Select ( srcBkpt => Protocol . DebugAdapter . Breakpoint . Create (
510517 srcBkpt , setBreakpointsParams . Source . Path , message , verified : this . noDebug ) ) ;
You can’t perform that action at this time.
0 commit comments