pub enum RpcRequestParsingError {
RequestInvalidType {
actual_type: String,
},
ParamsInvalidType {
actual_type: String,
},
VersionMissing {
id: Option<Value>,
method: Option<String>,
},
VersionInvalid {
id: Option<Value>,
method: Option<String>,
version: Value,
},
MethodMissing {
id: Option<Value>,
},
MethodInvalidType {
id: Option<Value>,
method: Value,
},
NotificationHasId {
method: Option<String>,
id: Value,
},
MethodInvalid {
actual: String,
},
IdMissing {
method: Option<String>,
},
IdInvalid {
actual: String,
cause: String,
},
Parse(Error),
}Expand description
The RPC Request Parsing error is used when utilizing value.try_into()? or Request::from_value(value).
The design intent is to validate and provide as much context as possible when a specific validation fails.
Note: By design, we do not capture the “params” because they could be indefinitely large.
Note: In future releases, the capture of Value objects or arrays for those error variants
will be replaced with Value::String containing a message such as
"[object/array redacted, 'id' must be of type number, string, or equal to null]"
or "[object/array redacted, 'method' must be of type string]"
This approach aims to provide sufficient context for debugging the issue while preventing
the capture of indefinitely large values in the logs.
Variants§
RequestInvalidType
ParamsInvalidType
VersionMissing
VersionInvalid
MethodMissing
MethodInvalidType
NotificationHasId
MethodInvalid
IdMissing
IdInvalid
Parse(Error)
Trait Implementations§
Source§impl Debug for RpcRequestParsingError
impl Debug for RpcRequestParsingError
Source§impl Display for RpcRequestParsingError
impl Display for RpcRequestParsingError
Source§impl Error for RpcRequestParsingError
impl Error for RpcRequestParsingError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()