use std::fmt;
#[derive(Debug)]
pub enum GeoIpReaderError {
GetHostByNameError,
InvalidDatabaseType,
OpenFileError,
CorruptDatabase,
}
impl fmt::Display for GeoIpReaderError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
GeoIpReaderError::GetHostByNameError => write!(f, "Error getting host by name"),
GeoIpReaderError::InvalidDatabaseType => write!(f, "Invalid database type"),
GeoIpReaderError::OpenFileError => write!(f, "Cannot open file"),
GeoIpReaderError::CorruptDatabase => write!(f, "Corrupt database"),
}
}
}