-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
errors.go
40 lines (32 loc) · 1.16 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// SPDX-FileCopyrightText: 2021 The Go Language Server Authors
// SPDX-License-Identifier: BSD-3-Clause
package protocol
import "go.lsp.dev/jsonrpc2"
const (
// LSPReservedErrorRangeStart is the start range of LSP reserved error codes.
//
// It doesn't denote a real error code.
//
// @since 3.16.0.
LSPReservedErrorRangeStart jsonrpc2.Code = -32899
// CodeContentModified is the state change that invalidates the result of a request in execution.
//
// Defined by the protocol.
CodeContentModified jsonrpc2.Code = -32801
// CodeRequestCancelled is the cancellation error.
//
// Defined by the protocol.
CodeRequestCancelled jsonrpc2.Code = -32800
// LSPReservedErrorRangeEnd is the end range of LSP reserved error codes.
//
// It doesn't denote a real error code.
//
// @since 3.16.0.
LSPReservedErrorRangeEnd jsonrpc2.Code = -32800
)
var (
// ErrContentModified should be used when a request is canceled early.
ErrContentModified = jsonrpc2.NewError(CodeContentModified, "cancelled JSON-RPC")
// ErrRequestCancelled should be used when a request is canceled early.
ErrRequestCancelled = jsonrpc2.NewError(CodeRequestCancelled, "cancelled JSON-RPC")
)