From 70db8a2e8dde61ede4043507415dcc467e7c0128 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Fri, 30 Jun 2023 13:20:15 -0700 Subject: [PATCH] Log errors in pty host channel Fixes #186775 --- src/vs/platform/terminal/node/ptyService.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/vs/platform/terminal/node/ptyService.ts b/src/vs/platform/terminal/node/ptyService.ts index 2e98e0a888fcd..0befe7fb7a94f 100644 --- a/src/vs/platform/terminal/node/ptyService.ts +++ b/src/vs/platform/terminal/node/ptyService.ts @@ -46,7 +46,13 @@ export function traceRpc(_target: any, key: string, descriptor: any) { if (this.traceRpcArgs.simulatedLatency) { await timeout(this.traceRpcArgs.simulatedLatency); } - const result = await fn.apply(this, args); + let result: any; + try { + result = await fn.apply(this, args); + } catch (e) { + this.traceRpcArgs.logService.error(`[RPC Response] PtyService#${fn.name}`, e); + throw e; + } if (this.traceRpcArgs.logService.getLevel() === LogLevel.Trace) { this.traceRpcArgs.logService.trace(`[RPC Response] PtyService#${fn.name}`, result); }