pub enum CodeError {
Show 13 variants
Config(String),
Llm(String),
Tool {
tool: String,
message: String,
},
Session(String),
SessionClosed {
session_id: String,
},
BudgetExhausted {
resource: String,
reason: String,
},
Security(String),
Context(String),
Mcp(String),
Queue(String),
Io(Error),
Serialization(Error),
Internal(Error),
}Expand description
Categorized error type for A3S Code Core.
SDK bindings (Python/Node) can match on the variant to expose typed
exceptions (e.g., CodeConfigError, CodeLlmError).
Variants§
Config(String)
Configuration loading or parsing error
Llm(String)
LLM provider communication error
Tool
Tool execution error
Session(String)
Session management error
SessionClosed
Session has been closed; further operations are rejected.
Returned by send/stream (and their variants) after
AgentSession::close
— or Agent::close — has been called.
BudgetExhausted
A host-supplied BudgetGuard denied
the operation. The session is not closed — callers can re-try
after the host has re-allocated budget.
Security(String)
Security subsystem error
Context(String)
Context provider or context store error
Mcp(String)
MCP (Model Context Protocol) error
Queue(String)
Queue or lane error
Io(Error)
I/O error
Serialization(Error)
JSON serialization/deserialization error
Internal(Error)
Catch-all for errors not yet migrated to a specific variant.
The #[from] anyhow::Error conversion enables gradual migration:
any function returning anyhow::Result can be called with ? from
a function returning crate::error::Result without changes.
Trait Implementations§
Source§impl Error for CodeError
impl Error for CodeError
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()
Auto Trait Implementations§
impl Freeze for CodeError
impl !RefUnwindSafe for CodeError
impl Send for CodeError
impl Sync for CodeError
impl Unpin for CodeError
impl UnsafeUnpin for CodeError
impl !UnwindSafe for CodeError
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more