use std::io;
#[cfg(not(feature = "picodata_tarantool"))]
use tarantool::{error, network::client::tcp};
#[cfg(feature = "picodata_tarantool")]
use picodata_tarantool::system::tarantool::{error, network::client::tcp};
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("timeout")]
Timeout,
#[error("socket_closed")]
SocketClosed,
#[error("unsupported schema")]
UnsupportedSchema,
#[error("empty host")]
EmptyHost,
#[error("tcp: {0}")]
TCP(#[from] tcp::Error),
#[error("http: {0}")]
HTTP(http_types::Error),
#[error("tls: {0}")]
TLS(#[from] async_native_tls::Error),
#[error("tnt: {0}")]
TNT(#[from] error::Error),
#[error("url: {0}")]
URL(#[from] url::ParseError),
#[error("json: {0}")]
JSON(#[from] serde_json::Error),
#[error("io: {0}")]
IO(io::Error),
}