pub enum ToolError {
ExecutionFailed(String),
InvalidArguments(String),
Timeout(Duration),
Cancelled,
Network(String),
Io(Error),
Serialization(Error),
ValidationError {
field: String,
reason: String,
},
ResourceLimitExceeded(String),
PermissionDenied(String),
ToolNotFound(String),
Custom(Box<dyn Error + Send + Sync>),
}Expand description
Errors that can occur during tool execution
Variants§
ExecutionFailed(String)
InvalidArguments(String)
Timeout(Duration)
Cancelled
Network(String)
Io(Error)
Serialization(Error)
ValidationError
ResourceLimitExceeded(String)
PermissionDenied(String)
ToolNotFound(String)
Custom(Box<dyn Error + Send + Sync>)
Implementations§
Source§impl ToolError
impl ToolError
pub fn execution_failed(msg: impl Into<String>) -> Self
pub fn invalid_arguments(msg: impl Into<String>) -> Self
pub fn network(msg: impl Into<String>) -> Self
pub fn validation(field: impl Into<String>, reason: impl Into<String>) -> Self
pub fn resource_limit(msg: impl Into<String>) -> Self
pub fn permission_denied(msg: impl Into<String>) -> Self
pub fn tool_not_found(name: impl Into<String>) -> Self
pub fn custom(err: impl Error + Send + Sync + 'static) -> Self
pub fn kind(&self) -> ErrorKind
pub fn is_retryable(&self) -> bool
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 Freeze for ToolError
impl !RefUnwindSafe for ToolError
impl Send for ToolError
impl Sync for ToolError
impl Unpin 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