Skip to main content

nexql_tools/
error.rs

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