8000 fix: don't report InternalError on tsserver error response by rchl · Pull Request #709 · typescript-language-server/typescript-language-server · GitHub
[go: up one dir, main page]

Skip to content

fix: don't report InternalError on tsserver error response #709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
9 changes: 7 additions & 2 deletions src/tsp-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/

import { URI } from 'vscode-uri';
import { ResponseError } from 'vscode-languageserver';
import type lsp from 'vscode-languageserver';
import type { CancellationToken } from 'vscode-jsonrpc';
import { Logger, PrefixingLogger } from './utils/logger.js';
Expand Down Expand Up @@ -302,13 +303,17 @@ export class TspClient {
return this.executeAsync(CommandTypes.Geterr, args, token);
}

public request<K extends keyof StandardTsServerRequests>(
public async request<K extends keyof StandardTsServerRequests>(
command: K,
args: StandardTsServerRequests[K][0],
token?: CancellationToken,
config?: ExecConfig,
): Promise<ServerResponse.Response<StandardTsServerRequests[K][1]>> {
return this.execute(command, args, token, config);
try {
return await this.execute(command, args, token, config);
} catch (error) {
throw new ResponseError(1, (error as Error).message);
}
}

// Low-level API.
Expand Down
0