pub struct ErrorCode;Expand description
Standard JSON-RPC 2.0 error codes.
The range from -32768 to -32000 is reserved for pre-defined errors. The range from -32000 to -32099 is reserved for server errors. All other codes are available for application-defined errors.
Implementations§
Source§impl ErrorCode
impl ErrorCode
Sourcepub const PARSE_ERROR: i32 = -32700
pub const PARSE_ERROR: i32 = -32700
Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.
Sourcepub const INVALID_REQUEST: i32 = -32600
pub const INVALID_REQUEST: i32 = -32600
The JSON sent is not a valid Request object.
Sourcepub const METHOD_NOT_FOUND: i32 = -32601
pub const METHOD_NOT_FOUND: i32 = -32601
The method does not exist / is not available.
Sourcepub const INVALID_PARAMS: i32 = -32602
pub const INVALID_PARAMS: i32 = -32602
Invalid method parameter(s).
Sourcepub const INTERNAL_ERROR: i32 = -32603
pub const INTERNAL_ERROR: i32 = -32603
Internal JSON-RPC error.
Sourcepub const SERVER_ERROR_MIN: i32 = -32099
pub const SERVER_ERROR_MIN: i32 = -32099
The lowest reserved server error code.
Sourcepub const SERVER_ERROR_MAX: i32 = -32000
pub const SERVER_ERROR_MAX: i32 = -32000
The highest reserved server error code.
Sourcepub fn is_reserved(code: i32) -> bool
pub fn is_reserved(code: i32) -> bool
Returns true if the given code is in the reserved pre-defined error range.
Sourcepub fn is_server_error(code: i32) -> bool
pub fn is_server_error(code: i32) -> bool
Returns true if the given code is in the server error range.
Sourcepub fn default_message(code: i32) -> &'static str
pub fn default_message(code: i32) -> &'static str
Returns a human-readable default message for a given standard error code.