pub enum AgentError {
Llm(String),
LlmApi {
message: String,
},
LlmStream(String),
Json(String),
ToolNotFound {
name: String,
},
ToolArgsInvalid {
name: String,
raw: String,
},
ToolExecution {
name: String,
source: Box<AgentError>,
},
ApprovalDenied {
tool_name: String,
},
SessionNotFound(u64),
MaxTurnsExceeded {
limit: u32,
},
Cancelled,
Internal(String),
}Variants§
Llm(String)
LlmApi
LlmStream(String)
Json(String)
ToolNotFound
ToolArgsInvalid
ToolExecution
ApprovalDenied
SessionNotFound(u64)
MaxTurnsExceeded
Cancelled
Internal(String)
Implementations§
Source§impl AgentError
impl AgentError
pub fn llm(message: impl Into<String>) -> Self
pub fn json(message: impl Into<String>) -> Self
pub fn internal(message: impl Into<String>) -> Self
pub fn tool_not_found(name: impl Into<String>) -> Self
pub fn session_not_found(id: u64) -> Self
pub fn is_cancelled(&self) -> bool
pub fn is_retryable(&self) -> bool
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
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()
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
Mutably borrows from an owned value. Read more