use std::path::PathBuf;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum ConfigError {
#[error("invalid port '{value}': must be between 1 and 65535")]
InvalidPort {
value: String,
},
#[error("failed to parse port '{value}': {source}")]
PortParseError {
value: String,
#[source]
source: std::num::ParseIntError,
},
#[error("failed to parse bind address '{value}': {source}")]
InvalidBindAddr {
value: String,
#[source]
source: std::net::AddrParseError,
},
#[error("missing required environment variable: {name}")]
MissingEnvVar {
name: &'static str,
},
#[error("path does not exist: {path}")]
PathNotFound {
path: PathBuf,
},
#[error("path is not a file: {path}")]
NotAFile {
path: PathBuf,
},
#[error("path is not a directory: {path}")]
NotADirectory {
path: PathBuf,
},
}