Skip to content
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

Expose JSON-RPC Error Code in communication with LSP Server #1533

Open
soyrubio opened this issue Aug 5, 2024 · 1 comment
Open

Expose JSON-RPC Error Code in communication with LSP Server #1533

soyrubio opened this issue Aug 5, 2024 · 1 comment
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@soyrubio
Copy link

soyrubio commented Aug 5, 2024

Recently I stumbled upon an issue where I was unable to catch error codes from the LSP Server. If the client?.sendRequest fails, it returns an Error object. The Error here has the following interface:

interface Error {
    name: string;
    message: string;
    stack?: string;
}

Thus I am unable to catch any error code which I sent from the LSP server. If anyone knows a workaround for this I would be greatful, but nevertheless it could be a nice improvement to include the Error code in the interface.

@soyrubio soyrubio changed the title Expose JSON-RPC Error Code in LSP Client Expose JSON-RPC Error Code in communication with LSP Server Aug 6, 2024
@aeschli aeschli assigned dbaeumer and unassigned aeschli Aug 7, 2024
@dbaeumer
Copy link
Member

dbaeumer commented Aug 7, 2024

Which request are you sending to the server.

Usually all response errors are converted in lower layers and if it is a ResponseErrorLiteral the code will be preserve (see https://github.com/microsoft/vscode-languageserver-node/blob/dbaeumer/nutritious-vulture-turquoise/jsonrpc/src/common/connection.ts#L922)

Best would be you provide me with a GitHub repository I can clone with a minimal setup that demos what you are seeing.

@dbaeumer dbaeumer transferred this issue from microsoft/vscode Aug 7, 2024
@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants