#[non_exhaustive]pub enum ToolError {
Canceled,
InvalidArgs(BoxError),
Execution(BoxError),
}Expand description
Tool execution error.
The granularity is intentionally coarse — finer-grained error types are carried by
built-in tools themselves in the Execution source. Here we only distinguish the
broad categories that the main loop needs to handle differently.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Canceled
Canceled by the caller (triggered via ToolContext::cancel).
InvalidArgs(BoxError)
The tool arguments failed JSON parsing or schema validation. The main loop can send this back to the LLM so the model can fix the parameters and retry.
Execution(BoxError)
Runtime error (I/O failure, non-zero subprocess exit, network error, etc.).
Trait Implementations§
Source§impl Error for ToolError
impl Error for ToolError
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 !RefUnwindSafe for ToolError
impl !UnwindSafe for ToolError
impl Freeze for ToolError
impl Send for ToolError
impl Sync for ToolError
impl Unpin for ToolError
impl UnsafeUnpin for ToolError
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