use thiserror::Error;
#[derive(Debug, Eq, PartialEq, Error)]
#[non_exhaustive]
pub enum Error {
#[error("query is invalid: {error}")]
InvalidQueryError { error: String },
#[error("Failed to build URL: {error}")]
UrlConstructionError { error: String },
#[error("http protocol error: {error}")]
ProtocolError { error: String },
#[error("http protocol error: {error}")]
DeserializationError { error: String },
#[error("InfluxDB encountered the following error: {error}")]
DatabaseError { error: String },
#[error("API error with a status code: {0}")]
ApiError(u16),
#[error("connection error: {error}")]
ConnectionError { error: String },
}
#[cfg(feature = "chrono")]
#[derive(Clone, Copy, Debug, Error)]
#[error("The timestamp is too large to fit into an i64.")]
pub struct TimestampTooLargeError(pub(crate) ());
#[cfg(any(feature = "chrono", feature = "time"))]
#[derive(Clone, Copy, Debug, Error)]
pub enum TimeTryFromError<T, I> {
TimeError(#[source] T),
IntError(#[source] I),
}