#[non_exhaustive]pub struct RawJsonRpcError {
pub code: i32,
pub message: String,
pub data: MaybeUndefined<Value>,
pub extra: Map<String, Value>,
}Expand description
A JSON-RPC error without ACP-specific interpretation.
Raw transports and relays preserve unknown fields and distinguish omitted
data from explicit JSON null. Convert to crate::Error only when
dispatching an ACP response; other protocols have their own error domains.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.code: i32The peer’s numeric error code, not an ACP crate::ErrorCode.
message: StringThe peer’s error message.
data: MaybeUndefined<Value>Optional error data. Explicit null is retained separately from omission.
extra: Map<String, Value>Additional fields on the error object.
Implementations§
Source§impl RawJsonRpcError
impl RawJsonRpcError
Sourcepub fn new(code: i32, message: impl Into<String>) -> Self
pub fn new(code: i32, message: impl Into<String>) -> Self
Construct an error without data or extension fields.
Sourcepub fn into_acp_error(self) -> Error
pub fn into_acp_error(self) -> Error
Interpret this error as an ACP response for the typed dispatcher.
ACP’s error type does not model extension fields, so this intentionally
discards extra. Do not use it when forwarding raw frames or interpreting
errors from another protocol.
Trait Implementations§
Source§impl Clone for RawJsonRpcError
impl Clone for RawJsonRpcError
Source§impl Debug for RawJsonRpcError
impl Debug for RawJsonRpcError
Source§impl<'de> Deserialize<'de> for RawJsonRpcError
impl<'de> Deserialize<'de> for RawJsonRpcError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for RawJsonRpcError
impl Display for RawJsonRpcError
Source§impl Error for RawJsonRpcError
impl Error for RawJsonRpcError
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()