Skip to content

Update comment for jsonrpcReservedErrorRangeEnd #1315

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
Jul 12, 2021

Conversation

leegbestand
Copy link
Contributor

The comment states that it is the start of the range, but the variable name states it is the end. The variable name seems to be correct, so update the comment.

The comment states that it is the start of the range, but the variable name states it is the end. The variable name seems to be correct, so update the comment.
@rcjsuen
Copy link
Contributor

rcjsuen commented Jul 10, 2021

export const jsonrpcReservedErrorRangeStart: integer = -32099;
export const jsonrpcReservedErrorRangeEnd = -32000;

Looks like we have a bigger problem where the "end" is -32000 and the "start" is -32099...?

@KamasamaK
Copy link
Contributor

KamasamaK commented Jul 10, 2021

@rcjsuen The lspReservedErrorRangeStart and lspReservedErrorRangeEnd codes are the same way, so at least it's consistent. It's not not exactly intuitive, but it makes sense when you think about the start of a range most commonly being the lesser value.

The JSON-RPC 2.0 spec isn't even consistent on this for their Error object. In the text, it says "The error codes from and including -32768 to -32000 are reserved for pre-defined errors" for their entire reserved range, but in the table it's "-32000 to -32099" for the reserved server error range.

@dbaeumer
Copy link
Member

I named them that way since you usually get a next error by adding +1. Constantly doing this brings you from start to end.

@dbaeumer dbaeumer merged commit 20d92d3 into microsoft:gh-pages Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants