lspeasy / core/src / JSONRPCErrorCode
Variable: JSONRPCErrorCode
ts
const JSONRPCErrorCode: {
ContentModified: -32801;
InternalError: -32603;
InvalidParams: -32602;
InvalidRequest: -32600;
MethodNotFound: -32601;
ParseError: -32700;
RequestCancelled: -32800;
ServerCancelled: -32802;
ServerErrorEnd: -32000;
ServerErrorStart: -32099;
ServerNotInitialized: -32002;
UnknownErrorCode: -32001;
};Defined in: packages/core/src/utils/errors.ts:19
Numeric error codes defined by JSON-RPC 2.0 and the LSP specification.
Type Declaration
| Name | Type | Default value | Defined in |
|---|---|---|---|
ContentModified | -32801 | -32801 | packages/core/src/utils/errors.ts:35 |
InternalError | -32603 | -32603 | packages/core/src/utils/errors.ts:25 |
InvalidParams | -32602 | -32602 | packages/core/src/utils/errors.ts:24 |
InvalidRequest | -32600 | -32600 | packages/core/src/utils/errors.ts:22 |
MethodNotFound | -32601 | -32601 | packages/core/src/utils/errors.ts:23 |
ParseError | -32700 | -32700 | packages/core/src/utils/errors.ts:21 |
RequestCancelled | -32800 | -32800 | packages/core/src/utils/errors.ts:34 |
ServerCancelled | -32802 | -32802 | packages/core/src/utils/errors.ts:36 |
ServerErrorEnd | -32000 | -32000 | packages/core/src/utils/errors.ts:33 |
ServerErrorStart | -32099 | -32099 | packages/core/src/utils/errors.ts:32 |
ServerNotInitialized | -32002 | -32002 | packages/core/src/utils/errors.ts:28 |
UnknownErrorCode | -32001 | -32001 | packages/core/src/utils/errors.ts:29 |
Remarks
Use these constants when throwing ResponseError from request handlers so clients can programmatically distinguish error types.
Ranges:
-32700to-32600: JSON-RPC 2.0 standard errors-32899to-32800: LSP-reserved range-32099to-32000: Application-defined errors