pub enum AcpError {
MethodNotFound,
MethodNotImplemented {
method: AgentMethod,
},
InvalidParams {
reason: String,
},
InternalError {
message: String,
},
}Expand description
An ACP-specific error.
The variants are the JSON-RPC error codes the ACP spec names. The serving adapter maps each variant to a code and message on the wire; the consumer never has to know the codes.
§JSON-RPC error codes
-32601:MethodNotFound/MethodNotImplemented-32602:InvalidParams-32603:InternalError
The negative numbers are the JSON-RPC
standard’s reserved range. ACP v1.25.0
does not extend the implementation-defined
-32000..=-32099 range, so this enum has
the same surface as the JSON-RPC standard’s
own.
Variants§
MethodNotFound
The method name is not in the ACP
vocabulary. Maps to JSON-RPC -32601.
MethodNotImplemented
The method is known to ACP but the
consumer’s handler does not implement it.
Maps to JSON-RPC -32601 (the same code
as MethodNotFound; the distinction is
for the consumer’s logs).
Fields
method: AgentMethodThe method the consumer did not implement.
InvalidParams
The params could not be decoded into the
shape the handler expects. Maps to JSON-RPC
-32602.
Fields
InternalError
The handler failed in a way that is not
the caller’s fault. Maps to JSON-RPC
-32603.
Implementations§
Trait Implementations§
impl Eq for AcpError
Source§impl Error for AcpError
impl Error for AcpError
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()