Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Commit

Permalink
Always print errors to the output tab
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock committed Feb 7, 2024
1 parent 47dbd06 commit 3cf6881
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 = "";
}

Expand Down Expand Up @@ -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`);

Expand Down

0 comments on commit 3cf6881

Please sign in to comment.