pub struct ResponseError {
pub code: i64,
pub message: String,
pub data: Option<Value>,
}Expand description
The error in a response frame, in JSON-RPC shape. Runtime’s own errors use the codes below;
ACP errors returned by the agent (acpRequest etc.) pass through unchanged, code/data come
from the agent.
Fields§
§code: i64§message: String§data: Option<Value>Data attached to an agent error (e.g. {details}, {authMethods}); null if absent.
Implementations§
Source§impl ResponseError
impl ResponseError
Sourcepub const RUNTIME: i64 = -32000
pub const RUNTIME: i64 = -32000
Runtime failed to execute (no such agent, not the owner, agent exited…).
Sourcepub const CONNECTION_LOST: i64 = -32001
pub const CONNECTION_LOST: i64 = -32001
Connection lost: Runtime exited or cannot be written to. Generated locally by the client, never sent by Runtime.
pub const METHOD_NOT_FOUND: i64 = -32601
pub const INVALID_PARAMS: i64 = -32602
pub fn new(code: i64, message: impl Into<String>) -> Self
pub fn runtime(message: impl Into<String>) -> Self
pub fn connection_lost(message: impl Into<String>) -> Self
pub fn method_not_found(method: &str) -> Self
pub fn invalid_params(detail: impl Display) -> Self
Trait Implementations§
Source§impl Clone for ResponseError
impl Clone for ResponseError
Source§impl Debug for ResponseError
impl Debug for ResponseError
Source§impl<'de> Deserialize<'de> for ResponseError
impl<'de> Deserialize<'de> for ResponseError
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ResponseError
impl Display for ResponseError
Source§impl Error for ResponseError
impl Error for ResponseError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<&str> for ResponseError
impl From<&str> for ResponseError
Source§impl From<ResponseError> for String
impl From<ResponseError> for String
Source§fn from(error: ResponseError) -> Self
fn from(error: ResponseError) -> Self
Converts to this type from the input type.
Source§impl From<String> for ResponseError
impl From<String> for ResponseError
Source§impl PartialEq for ResponseError
impl PartialEq for ResponseError
Source§impl Serialize for ResponseError
impl Serialize for ResponseError
impl StructuralPartialEq for ResponseError
Auto Trait Implementations§
impl Freeze for ResponseError
impl RefUnwindSafe for ResponseError
impl Send for ResponseError
impl Sync for ResponseError
impl Unpin for ResponseError
impl UnsafeUnpin for ResponseError
impl UnwindSafe for ResponseError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more