Skip to main content

connectorx/sources/clickhouse/
errors.rs

1use thiserror::Error;
2
3/// Errors raised by the ClickHouse source.
4#[derive(Error, Debug)]
5pub enum ClickHouseSourceError {
6    /// Generic ConnectorX error.
7    #[error(transparent)]
8    ConnectorXError(#[from] crate::errors::ConnectorXError),
9
10    /// The connection string is not a valid URL.
11    #[error(transparent)]
12    UrlParseError(#[from] url::ParseError),
13
14    /// The row count of a partition could not be read.
15    #[error("Failed to get row count")]
16    GetNRowsFailed,
17
18    /// A ClickHouse column type could not be parsed.
19    #[error("Failed to parse type: {0}")]
20    TypeParseError(String),
21
22    /// Any other error.
23    #[error(transparent)]
24    Other(#[from] anyhow::Error),
25}