sqlx_exasol_impl/options/
error.rs1use thiserror::Error as ThisError;
2
3use crate::{options::URL_SCHEME, SqlxError};
4
5#[derive(Debug, ThisError)]
7pub enum ExaConfigError {
8 #[error("no host provided")]
9 MissingHost,
10 #[error("could not resolve hostname")]
11 CouldNotResolve(#[from] std::io::Error),
12 #[error("no authentication method provided")]
13 MissingAuthMethod,
14 #[error("multiple authentication methods provided")]
15 MultipleAuthMethods,
16 #[error("invalid URL scheme: {0}, expected: {URL_SCHEME}")]
17 InvalidUrlScheme(String),
18 #[error("invalid connection parameter: {0}")]
19 InvalidParameter(&'static str),
20}
21
22impl From<ExaConfigError> for SqlxError {
23 fn from(value: ExaConfigError) -> Self {
24 Self::Configuration(value.into())
25 }
26}