From 58c83f27fae3717dfcaf2c57f2902ea3192fb0fa Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Thu, 2 Sep 2021 11:01:52 -0700 Subject: [PATCH] :lipstick: --- .../workbench/api/browser/mainThreadDebugService.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadDebugService.ts b/src/vs/workbench/api/browser/mainThreadDebugService.ts index 649157c0cfe..ca2dcb4998c 100644 --- a/src/vs/workbench/api/browser/mainThreadDebugService.ts +++ b/src/vs/workbench/api/browser/mainThreadDebugService.ts @@ -219,7 +219,7 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb return undefined; } - public $startDebugging(folder: UriComponents | undefined, nameOrConfig: string | IDebugConfiguration, options: IStartDebuggingOptions): Promise { + public async $startDebugging(folder: UriComponents | undefined, nameOrConfig: string | IDebugConfiguration, options: IStartDebuggingOptions): Promise { const folderUri = folder ? uri.revive(folder) : undefined; const launch = this.debugService.getConfigurationManager().getLaunch(folderUri); const parentSession = this.getSession(options.parentSessionID); @@ -232,11 +232,11 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb debugUI: options.debugUI, compoundRoot: parentSession?.compoundRoot }; - return this.debugService.startDebugging(launch, nameOrConfig, debugOptions, !options.suppressSaveBeforeStart).then(success => { - return success; - }, err => { - return Promise.reject(new Error(err && err.message ? err.message : 'cannot start debugging')); - }); + try { + return this.debugService.startDebugging(launch, nameOrConfig, debugOptions, !options.suppressSaveBeforeStart); + } catch (err) { + throw new Error(err && err.message ? err.message : 'cannot start debugging'); + } } public $setDebugSessionName(sessionId: DebugSessionUUID, name: string): void {