use std::io::Error as IoError;
use super::types::CommonError;
impl CommonError {
pub fn io_error(message: &str) -> Self {
CommonError::Io(IoError::other(message))
}
pub fn cache_lock() -> Self {
CommonError::CacheLock
}
pub fn serialization(detail: &'static str) -> Self {
CommonError::Serialization(detail)
}
pub fn deserialization(detail: &'static str) -> Self {
CommonError::Deserialization(detail)
}
pub fn unsupported_file_type(detail: &'static str) -> Self {
CommonError::UnsupportedFileType(detail)
}
pub fn data_not_found() -> Self {
CommonError::DataNotFound
}
pub fn unable_to_fresh_data() -> Self {
CommonError::UnableToFreshData
}
pub fn stale_internal_none() -> Self {
CommonError::StaleInternalNone
}
pub fn timeout() -> Self {
CommonError::Timeout
}
pub fn filename_error() -> Self {
CommonError::FilenameError
}
pub fn invalid_filename_encoding() -> Self {
CommonError::InvalidFilenameEncoding
}
pub fn missing_timestamp_separator() -> Self {
CommonError::MissingTimestampSeparator
}
pub fn missing_file_extension() -> Self {
CommonError::MissingFileExtension
}
pub fn timestamp_parse_error() -> Self {
CommonError::TimestampParseError
}
}