pub enum ToolError {
InvalidInput(String),
NotFound(String),
PermissionDenied(String),
OperationFailed(String),
InternalError(String),
}Expand description
Specialized error type for tool execution
Variants§
InvalidInput(String)
Invalid input provided to the tool
NotFound(String)
Requested resource was not found
PermissionDenied(String)
Permission denied for the operation
OperationFailed(String)
Operation failed for a specific reason
InternalError(String)
Internal error occurred
Implementations§
Source§impl ToolError
impl ToolError
Sourcepub fn invalid_input(msg: impl Into<String>) -> Self
pub fn invalid_input(msg: impl Into<String>) -> Self
Create an InvalidInput error
Sourcepub fn permission_denied(msg: impl Into<String>) -> Self
pub fn permission_denied(msg: impl Into<String>) -> Self
Create a PermissionDenied error
Sourcepub fn operation_failed(msg: impl Into<String>) -> Self
pub fn operation_failed(msg: impl Into<String>) -> Self
Create an OperationFailed error
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToolError
impl<'de> Deserialize<'de> for ToolError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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()
Source§impl From<ToolError> for IcarusError
impl From<ToolError> for IcarusError
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