Skip to content

Commit 4592fe2

Browse files
committed
errors: cleanup Code constants
1 parent dc8f8e9 commit 4592fe2

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

errors.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,42 @@ type Code int64
1515

1616
const (
1717
// ParseError is the invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.
18-
ParseError = Code(-32700)
18+
ParseError Code = -32700
1919

2020
// InvalidRequest is the JSON sent is not a valid Request object.
21-
InvalidRequest = Code(-32600)
21+
InvalidRequest Code = -32600
2222

2323
// MethodNotFound is the method does not exist / is not available.
24-
MethodNotFound = Code(-32601)
24+
MethodNotFound Code = -32601
2525

2626
// InvalidParams is the invalid method parameter(s).
27-
InvalidParams = Code(-32602)
27+
InvalidParams Code = -32602
2828

2929
// InternalError is the internal JSON-RPC error.
30-
InternalError = Code(-32603)
30+
InternalError Code = -32603
3131

3232
// ServerNotInitialized is the error of server not initialized.
33-
ServerNotInitialized = Code(-32002)
33+
ServerNotInitialized Code = -32002
3434

3535
// UnknownError should be used for all non coded errors.
36-
UnknownError = Code(-32001)
36+
UnknownError Code = -32001
3737

3838
// RequestCancelled is the cancellation error.
3939
//
4040
// Defined by the Language Server Protocol.
41-
RequestCancelled = Code(-32800)
41+
RequestCancelled Code = -32800
4242

4343
// ContentModified is the state change that invalidates the result of a request in execution.
4444
//
4545
// Defined by the Language Server Protocol.
46-
ContentModified = Code(-32801)
46+
ContentModified Code = -32801
4747

4848
// ServerOverloaded is returned when a message was refused due to a
4949
// server being temporarily unable to accept any new messages.
50-
ServerOverloaded = Code(-32000)
50+
ServerOverloaded Code = -32000
5151

52-
codeServerErrorStart = Code(-32099) //nolint:deadcode,varcheck
53-
codeServerErrorEnd = Code(-32000) //nolint:deadcode,varcheck
52+
codeServerErrorStart Code = -32099
53+
codeServerErrorEnd Code = -32000
5454
)
5555

5656
// Error represents a jsonrpc2 error.

0 commit comments

Comments
 (0)