Skip to main content

connectorx/sources/mssql/
errors.rs

1use std::string::FromUtf8Error;
2use thiserror::Error;
3
4#[derive(Error, Debug)]
5pub enum MsSQLSourceError {
6    #[error("Cannot get # of rows in the partition")]
7    GetNRowsFailed,
8
9    #[error(transparent)]
10    ConnectorXError(#[from] crate::errors::ConnectorXError),
11
12    #[cfg(feature = "src_mssql_tiberius")]
13    #[error(transparent)]
14    MsSQLError(#[from] tiberius::error::Error),
15
16    #[cfg(feature = "src_mssql_tiberius")]
17    #[error(transparent)]
18    MsSQLRuntimeError(#[from] bb8::RunError<bb8_tiberius::Error>),
19
20    #[cfg(feature = "src_mssql_tiberius")]
21    #[error(transparent)]
22    MsSQLPoolError(#[from] bb8_tiberius::Error),
23
24    #[cfg(feature = "src_mssql_tds")]
25    #[error(transparent)]
26    MsSQLTdsError(#[from] mssql_tds::error::Error),
27
28    #[error(transparent)]
29    MsSQLUrlError(#[from] url::ParseError),
30
31    #[error(transparent)]
32    MsSQLUrlDecodeError(#[from] FromUtf8Error),
33
34    /// Any other errors that are too trivial to be put here explicitly.
35    #[error(transparent)]
36    Other(#[from] anyhow::Error),
37}