@@ -19,6 +19,7 @@ import { env as processEnv } from 'vs/base/common/process';
1919import { IOpenerService } from 'vs/platform/opener/common/opener' ;
2020import { IDisposable , dispose } from 'vs/base/common/lifecycle' ;
2121import { CancellationToken } from 'vs/base/common/cancellation' ;
22+ import { INotificationService } from 'vs/platform/notification/common/notification' ;
2223
2324/**
2425 * This interface represents a single command line argument split into a "prefix" and a "path" half.
@@ -79,7 +80,8 @@ export class RawDebugSession implements IDisposable {
7980 private readonly telemetryService : ITelemetryService ,
8081 public readonly customTelemetryService : ITelemetryService | undefined ,
8182 private readonly extensionHostDebugService : IExtensionHostDebugService ,
82- private readonly openerService : IOpenerService
83+ private readonly openerService : IOpenerService ,
84+ private readonly notificationService : INotificationService
8385 ) {
8486 this . debugAdapter = debugAdapter ;
8587 this . _capabilities = Object . create ( null ) ;
@@ -632,24 +634,28 @@ export class RawDebugSession implements IDisposable {
632634 return errors . canceled ( ) ;
633635 }
634636
635- const error = errorResponse && errorResponse . body ? errorResponse . body . error : null ;
636- const errorMessage = errorResponse ? errorResponse . message || '' : '' ;
637+ const error : DebugProtocol . Message | undefined = errorResponse ? .body ?. error ;
638+ const errorMessage = errorResponse ? .message || '' ;
637639
638640 if ( error && error . sendTelemetry ) {
639641 const telemetryMessage = error ? formatPII ( error . format , true , error . variables ) : errorMessage ;
640642 this . telemetryDebugProtocolErrorResponse ( telemetryMessage ) ;
641643 }
642644
643645 const userMessage = error ? formatPII ( error . format , false , error . variables ) : errorMessage ;
644- if ( error && error . url ) {
646+ const url = error ?. url ;
647+ if ( error && url ) {
645648 const label = error . urlLabel ? error . urlLabel : nls . localize ( 'moreInfo' , "More Info" ) ;
646649 return createErrorWithActions ( userMessage , {
647650 actions : [ new Action ( 'debug.moreInfo' , label , undefined , true , ( ) => {
648- this . openerService . open ( URI . parse ( error . url ) ) ;
651+ this . openerService . open ( URI . parse ( url ) ) ;
649652 return Promise . resolve ( null ) ;
650653 } ) ]
651654 } ) ;
652655 }
656+ if ( error && error . format && error . showUser ) {
657+ this . notificationService . error ( error . format ) ;
658+ }
653659
654660 return new Error ( userMessage ) ;
655661 }
0 commit comments