From 794fd92b30a0aef5780a8664368e481509edac1c Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Fri, 26 Feb 2021 14:45:11 +0100 Subject: [PATCH] Fixed custom debug request handling. Forward the `body` instead of the `response` object. Signed-off-by: Akos Kitta --- packages/plugin-ext/src/plugin/node/debug/debug.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/plugin-ext/src/plugin/node/debug/debug.ts b/packages/plugin-ext/src/plugin/node/debug/debug.ts index 5ae194e78d904..0e96373b077c4 100644 --- a/packages/plugin-ext/src/plugin/node/debug/debug.ts +++ b/packages/plugin-ext/src/plugin/node/debug/debug.ts @@ -282,7 +282,13 @@ export class DebugExtImpl implements DebugExt { type: debugConfiguration.type, name: debugConfiguration.name, configuration: debugConfiguration, - customRequest: (command: string, args?: any) => this.proxy.$customRequest(sessionId, command, args) + customRequest: async (command: string, args?: any) => { + const response = await this.proxy.$customRequest(sessionId, command, args); + if (response && response.success) { + return response.body; + } + return Promise.reject(new Error(response.message ?? 'custom request failed')); + } }; const tracker = await this.createDebugAdapterTracker(theiaSession);