/** * A JSON-RPC 2.0 response error * * @see {@link https://www.jsonrpc.org/specification#error_object} */ /** * Error codes defined in JSON-RPC 2.0 * * Codes -32000 to -32099 are reserved for implementation-defined server-errors. */ export declare enum JsonRpcErrorCode { /** * Invalid JSON was received by the server. * An error occurred on the server while parsing the JSON text. */ ParseError = -32700, /** * The JSON sent is not a valid Request object. */ InvalidRequest = -32600, /** * The method does not exist / is not available. */ MethodNotFound = -32601, /** * Invalid method parameter(s). */ InvalidParams = -32602, /** * Internal JSON-RPC error. */ InternalError = -32603, /** * Generic server error. */ ServerError = -32000, /** * Capability error **/ CapabilityError = -32005 } export declare class JsonRpcError { readonly name = "JsonRpcError"; /** * A number that indicates the error type that occurred. * This MUST be an integer. */ readonly code: JsonRpcErrorCode; /** * A string providing a short description of the error. * The message SHOULD be limited to a concise single sentence. */ readonly message: string; /** * A primitive or structured value that contains additional information about the error. * This may be omitted. * The value of this member is defined by the Server (e.g. detailed error information, * nested errors etc.). */ readonly data?: any; constructor(code: number, message: string, data?: any); /** * Translate an `Error` into a `JsonRpcError`. */ static fromError(error: Error): JsonRpcError; /** * Translate a `JsonRpcError` into other application * specific errors. */ static toError(error: JsonRpcError): Error; }