pub enum ToolError {
ToolNotFound {
tool_name: String,
},
ExecutionFailed {
tool_name: String,
message: String,
},
SchemaValidationFailed {
tool_name: String,
message: String,
},
}Expand description
A tool failed for reasons the model can’t fix by retrying with different
arguments. Most tool failures (bad args, non-zero bash exit, file-not-found,
timeouts) flow through ToolResult::Error
instead; those reach the model as tool-result messages.
Variants§
ToolNotFound
Registry has no tool with this name. The loop forwards the failure to the model as a tool-result error so it can pick a different tool.
ExecutionFailed
The tool was invoked but its execution raised an error. Covers harness
wiring gaps, persistence/IO failures, and anything else a tool returns
via Err(...).
SchemaValidationFailed
A schema-checked tool rejected the model’s payload. Distinct from
ExecutionFailed so the loop can apply the dedicated retry budget
(policies.max_schema_retries) and emit
ToolFailureKind::SchemaValidationFailed.
Implementations§
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)>
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 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
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.