Skip to main content

nexql_tools/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum ToolError {
5    #[error("unknown tool: {0}")]
6    Unknown(String),
7
8    #[error("invalid arguments: {0}")]
9    InvalidArgs(String),
10
11    #[error("tool execution failed: {0}")]
12    Execution(String),
13
14    #[error(transparent)]
15    Conn(#[from] nexql_conn::ConnError),
16
17    #[error(transparent)]
18    Policy(#[from] nexql_policy::PolicyError),
19
20    #[error(transparent)]
21    Index(#[from] nexql_index::IndexError),
22
23    #[error(transparent)]
24    Postgres(#[from] tokio_postgres::Error),
25}