#[derive(Debug, thiserror::Error)]
pub(crate) enum ToolError {
#[error("{0}")]
InvalidInput(String),
#[error("{0}")]
Fetch(String),
#[error("{0}")]
Internal(String),
}
impl ToolError {
pub(crate) fn invalid(msg: impl Into<String>) -> Self {
Self::InvalidInput(msg.into())
}
pub(crate) fn fetch(msg: impl Into<String>) -> Self {
Self::Fetch(msg.into())
}
pub(crate) fn internal(msg: impl Into<String>) -> Self {
Self::Internal(msg.into())
}
}
pub(crate) type ToolResult<T> = Result<T, ToolError>;