pub enum AgentError {
SessionNotFound(String),
LLM(String),
LLMOverflow(String),
StreamTimeout(String),
Tool(String),
Budget(String),
Cancelled,
}Expand description
Errors that can occur during agent operations
Variants§
SessionNotFound(String)
Session with the specified ID was not found
LLM(String)
Error from LLM provider (API error, network error, etc.)
LLMOverflow(String)
LLM request exceeded provider context/input limits and requires host-side overflow recovery before retry.
StreamTimeout(String)
The provider’s stream stalled mid-response: no chunk was received within the inter-chunk idle deadline (issue #28). This indicates a hung connection rather than a slow-but-healthy stream — the consume loop resets the deadline on every received chunk, so a legitimately long stream that keeps producing data never trips it.
Tool(String)
Error during tool execution
Budget(String)
Token budget exceeded error
Cancelled
Agent execution was cancelled by user
Implementations§
Source§impl AgentError
impl AgentError
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Returns true if this error represents a user-initiated cancellation.
Prefer this over substring-matching the error message: a reworded or localized message must not silently break cancellation/terminal-status logic.
Trait Implementations§
Source§impl Debug for AgentError
impl Debug for AgentError
Source§impl Display for AgentError
impl Display for AgentError
Source§impl Error for AgentError
impl Error for AgentError
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()
Auto Trait Implementations§
impl Freeze for AgentError
impl RefUnwindSafe for AgentError
impl Send for AgentError
impl Sync for AgentError
impl Unpin for AgentError
impl UnsafeUnpin for AgentError
impl UnwindSafe for AgentError
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> 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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.