pub enum ToolError {
Respond(String),
Fatal(String),
}Expand description
How a tool call failed, split into exactly two recovery paths (ADR-0004).
Default everything to ToolError::Respond. Bad arguments, an unknown
tool, a not-found path, a failed command, a timeout — all are soft: they
become a tool_result { is_error: true } the model reads and retries from.
ToolError::Fatal is reserved for the rare case where the transcript itself
is unrecoverable; it aborts the turn with a non-zero exit.
Variants§
Respond(String)
Soft error: surfaced to the model as an is_error tool result so it can
self-correct. The loop keeps iterating.
Fatal(String)
Hard error: the transcript is unrecoverable; abort the turn.
Trait Implementations§
Source§impl Error for ToolError
impl Error for ToolError
1.30.0 · 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 ToolError
impl RefUnwindSafe for ToolError
impl Send for ToolError
impl Sync for ToolError
impl Unpin for ToolError
impl UnsafeUnpin for ToolError
impl UnwindSafe 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