Skip to content

Commit

Permalink
Fixed custom debug request handling.
Browse files Browse the repository at this point in the history
Forward the `body` instead of the `response` object.

Signed-off-by: Akos Kitta <[email protected]>
  • Loading branch information
Akos Kitta authored and kittaakos committed Mar 2, 2021
1 parent ab74a91 commit 794fd92
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/plugin-ext/src/plugin/node/debug/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 794fd92

Please sign in to comment.