@@ -512,12 +512,10 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape {
512512
513513 public async $onDidStartTaskProcess ( value : tasks . TaskProcessStartedDTO ) : Promise < void > {
514514 const execution = await this . getTaskExecution ( value . id ) ;
515- if ( execution ) {
516- this . _onDidTaskProcessStarted . fire ( {
517- execution : execution ,
518- processId : value . processId
519- } ) ;
520- }
515+ this . _onDidTaskProcessStarted . fire ( {
516+ execution : execution ,
517+ processId : value . processId
518+ } ) ;
521519 }
522520
523521 public get onDidEndTaskProcess ( ) : Event < vscode . TaskProcessEndEvent > {
@@ -526,12 +524,10 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape {
526524
527525 public async $onDidEndTaskProcess ( value : tasks . TaskProcessEndedDTO ) : Promise < void > {
528526 const execution = await this . getTaskExecution ( value . id ) ;
529- if ( execution ) {
530- this . _onDidTaskProcessEnded . fire ( {
531- execution : execution ,
532- exitCode : value . exitCode
533- } ) ;
534- }
527+ this . _onDidTaskProcessEnded . fire ( {
528+ execution : execution ,
529+ exitCode : value . exitCode
530+ } ) ;
535531 }
536532
537533 protected abstract provideTasksInternal ( validTypes : { [ key : string ] : boolean ; } , taskIdPromises : Promise < void > [ ] , handler : HandlerData , value : vscode . Task [ ] | null | undefined ) : { tasks : tasks . TaskDTO [ ] , extension : IExtensionDescription } ;
@@ -643,9 +639,11 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape {
643639 } ) ;
644640
645641 this . _taskExecutionPromises . set ( execution . id , createdResult ) ;
646- return createdResult . then ( result => {
647- this . _taskExecutions . set ( execution . id , result ) ;
648- return result ;
642+ return createdResult . then ( executionCreatedResult => {
643+ this . _taskExecutions . set ( execution . id , executionCreatedResult ) ;
644+ return executionCreatedResult ;
645+ } , rejected => {
646+ return Promise . reject ( rejected ) ;
649647 } ) ;
650648 }
651649
0 commit comments