Return task execution early from executeTask

Fixes #100361
This commit is contained in:
Alex Ross
2020-06-17 13:54:21 +02:00
parent 1abf21d3d8
commit d52f137ed5
2 changed files with 7 additions and 4 deletions

View File

@@ -59,7 +59,8 @@ export class ExtHostTask extends ExtHostTaskBase {
throw new Error('Task from execution DTO is undefined');
}
const execution = await this.getTaskExecution(executionDTO, task);
return this._proxy.$executeTask(executionDTO.task).then(() => execution);
this._proxy.$executeTask(executionDTO.task).catch(error => { throw new Error(error); });
return execution;
} else {
const dto = TaskDTO.from(task, extension);
if (dto === undefined) {
@@ -74,7 +75,8 @@ export class ExtHostTask extends ExtHostTaskBase {
}
// Always get the task execution first to prevent timing issues when retrieving it later
const execution = await this.getTaskExecution(await this._proxy.$getTaskExecution(dto), task);
return this._proxy.$executeTask(dto).then(() => execution);
this._proxy.$executeTask(dto).catch(error => { throw new Error(error); });
return execution;
}
}