MCPcopy Create free account
hub / github.com/actix/examples / std

Method std

json/jsonrpc/src/convention.rs:38–54  ·  view source on GitHub ↗
(code: i32)

Source from the content-addressed store, hash-verified

36 }
37
38 pub fn std(code: i32) -> Self {
39 match code {
40 // Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.
41 -32700 => ErrorData::new(-32700, "Parse error"),
42 // The JSON sent is not a valid Request object.
43 -32600 => ErrorData::new(-32600, "Invalid Request"),
44 // The method does not exist / is not available.
45 -32601 => ErrorData::new(-32601, "Method not found"),
46 // Invalid method parameter(s).
47 -32602 => ErrorData::new(-32602, "Invalid params"),
48 // Internal JSON-RPC error.
49 -32603 => ErrorData::new(-32603, "Internal error"),
50 // The error codes from and including -32768 to -32000 are reserved for pre-defined errors. Any code within
51 // this range, but not defined explicitly below is reserved for future use.
52 _ => panic!("Undefined pre-defined error codes"),
53 }
54 }
55
56 /// Prints out the value as JSON string.
57 pub fn dump(&self) -> String {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected