pub enum ToolError<E: Display> {
Connection {
source: ConnectionError,
},
AccessDenied {
message: String,
},
Tool(E),
}Expand description
The top-level error type returned by all MCP tools. Wraps errors common to every tool (connection pool failures, access control denials) and delegates to a tool-specific inner error for anything unique to the individual tool’s logic.
Variants§
Connection
Failed to check out or configure a database connection.
Fields
§
source: ConnectionErrorThe underlying connection error.
AccessDenied
The SQL statement was rejected by the access control authorizer. The query was syntactically valid but the configured permissions forbid the requested operation.
Tool(E)
An error specific to the tool’s own logic, forwarded from the tool’s dedicated error type.
Trait Implementations§
Source§impl<E: Display> Error for ToolError<E>
impl<E: Display> Error for ToolError<E>
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<E> Freeze for ToolError<E>where
E: Freeze,
impl<E> !RefUnwindSafe for ToolError<E>
impl<E> Send for ToolError<E>where
E: Send,
impl<E> Sync for ToolError<E>where
E: Sync,
impl<E> Unpin for ToolError<E>where
E: Unpin,
impl<E> UnsafeUnpin for ToolError<E>where
E: UnsafeUnpin,
impl<E> !UnwindSafe for ToolError<E>
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