pub enum ToolExecutionError {
Cancelled,
PermissionRequired(Box<ToolPermissionRequirement>),
Infrastructure {
message: String,
},
}Expand description
Infrastructure-level errors raised by tool executors.
Use this for cancellation, runtime-mediated permission escalations, or
infrastructure failures only. If the tool ran and produced a domain-level
failure, return a failed ToolExecutionOutcome instead.
Variants§
Cancelled
Tool execution was cancelled cooperatively.
PermissionRequired(Box<ToolPermissionRequirement>)
Tool requires runtime permission review before accessing an external capability.
Infrastructure
Tool execution could not complete because the executor infrastructure failed.
Implementations§
Source§impl ToolExecutionError
impl ToolExecutionError
Sourcepub fn infrastructure(message: impl Into<String>) -> Self
pub fn infrastructure(message: impl Into<String>) -> Self
Creates an infrastructure error.
Infrastructure errors leave the pending tool call unresolved.
Sourcepub fn permission_required(requirement: ToolPermissionRequirement) -> Self
pub fn permission_required(requirement: ToolPermissionRequirement) -> Self
Requests runtime permission review before retrying the tool execution.
Trait Implementations§
Source§impl Debug for ToolExecutionError
impl Debug for ToolExecutionError
Source§impl Display for ToolExecutionError
impl Display for ToolExecutionError
Source§impl Error for ToolExecutionError
impl Error for ToolExecutionError
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 Forget for ToolExecutionError
impl Freeze for ToolExecutionErrorwhere
*const ToolPermissionRequirement is !null: Freeze,
PhantomData<ToolPermissionRequirement>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
impl Move for ToolExecutionError
impl RefUnwindSafe for ToolExecutionError
impl Send for ToolExecutionError
impl Sync for ToolExecutionError
impl Unpin for ToolExecutionError
impl UnsafeUnpin for ToolExecutionErrorwhere
*const ToolPermissionRequirement is !null: UnsafeUnpin,
PhantomData<ToolPermissionRequirement>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for ToolExecutionError
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