use thiserror::Error;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Error, Debug)]
pub enum Error {
#[error("Bluetooth error: {0}")]
Bluetooth(#[from] bluer::Error),
#[error("HTTP error: {0}")]
Http(#[from] reqwest::Error),
#[error("JSON error: {0}")]
Json(#[from] serde_json::Error),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("Cap'n Proto error: {0}")]
Capnp(#[from] capnp::Error),
#[error("Cap'n Proto schema error: {0}")]
CapnpSchema(#[from] capnp::NotInSchema),
#[error("UTF-8 error: {0}")]
Utf8(#[from] std::str::Utf8Error),
#[error("OIDC error: {0}")]
Oidc(String),
#[error("Device not found: {0}")]
DeviceNotFound(String),
#[error("Invalid device address: {0}")]
InvalidDeviceAddress(String),
#[error("API error: {0}")]
Api(String),
#[error("Configuration error: {0}")]
Config(String),
#[error("General error: {0}")]
General(String),
}