pub enum AcpPeerError {
Spawn(Error),
Write(Error),
Decode(Error),
IllShapedReply(String),
Timeout(Duration),
JsonRpc {
code: i64,
message: String,
},
}Expand description
Every error the ACP stdio peer can produce.
The variants are mapped from the underlying
tokio::io::Error, serde_json::Error, and the
peer’s own protocol errors. A consumer that
matches on the variants knows what category of
failure happened, not just that “something
failed”.
Variants§
Spawn(Error)
The peer could not be spawned, or the stdio pipes could not be wired up.
Write(Error)
Writing an envelope to the child’s stdin failed. The peer is unrecoverable: the child’s write side is broken and the reader task is about to see EOF.
Decode(Error)
The reply from the child was not a well-formed JSON-RPC envelope. The peer is recoverable: future requests can still succeed if the agent’s framing is consistent and this one frame was a one-off.
IllShapedReply(String)
The reply was well-formed JSON but did
not match the JSON-RPC 2.0 shape the
peer expects (id must be present on a
reply, result/error exactly one).
Timeout(Duration)
The reply was not received within the configured timeout. The default is 30s; a consumer that knows the agent is slow can override.
JsonRpc
The reply was a JSON-RPC error. The error code and message are part of the error; the consumer is the one that decides whether to retry, surface, or fail.
Trait Implementations§
Source§impl Debug for AcpPeerError
impl Debug for AcpPeerError
Source§impl Display for AcpPeerError
impl Display for AcpPeerError
Source§impl Error for AcpPeerError
impl Error for AcpPeerError
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()