From 3cf688110d25629324430c999f34b1d8e38608bc Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Wed, 7 Feb 2024 15:03:00 -0500 Subject: [PATCH] Always print errors to the output tab --- src/client.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/client.ts b/src/client.ts index 3a815b02..e79a73f2 100644 --- a/src/client.ts +++ b/src/client.ts @@ -131,6 +131,7 @@ export default class Client extends LanguageClient implements ClientInterface { private readonly baseFolder; private requestId = 0; + #outputChannel: WorkspaceChannel; #context: vscode.ExtensionContext; #formatter: string; @@ -162,6 +163,7 @@ export default class Client extends LanguageClient implements ClientInterface { this.createTestItems = createTestItems; this.#context = context; this.ruby = ruby; + this.#outputChannel = outputChannel; this.#formatter = ""; } @@ -254,6 +256,11 @@ export default class Client extends LanguageClient implements ClientInterface { telemetryData.errorMessage = error.data.errorMessage; telemetryData.backtrace = error.data.backtrace; errorResult = error; + + // Also display errors in the output channel. The intention is to make it easier for users to report issues + this.#outputChannel.error( + `Server error: ${telemetryData.errorClass} - ${telemetryData.errorMessage}\n\n${telemetryData.backtrace}`, + ); } Perf.mark(`${benchmarkId}.end`);