use thiserror::Error;
#[derive(Error, Debug)]
pub enum CountryPackError {
#[error("Invalid country code: {0}")]
InvalidCountryCode(String),
#[error("Failed to parse country pack: {0}")]
ParseError(String),
#[error("Merge error: {0}")]
MergeError(String),
#[error("Directory error: {0}")]
DirectoryError(String),
#[error("Schema version mismatch: expected {expected}, found {found}")]
SchemaVersionMismatch { expected: String, found: String },
}
impl CountryPackError {
pub fn parse(msg: impl Into<String>) -> Self {
Self::ParseError(msg.into())
}
pub fn merge(msg: impl Into<String>) -> Self {
Self::MergeError(msg.into())
}
pub fn directory(msg: impl Into<String>) -> Self {
Self::DirectoryError(msg.into())
}
}