diff --git a/src/error.rs b/src/error.rs index 7a8bd9a..ecf1156 100644 --- a/src/error.rs +++ b/src/error.rs @@ -20,6 +20,8 @@ pub enum Error { DirectoryIsNotEmpty, /// File system internal structures are corrupted/invalid. CorruptedFileSystem, + /// File system is marked dirty. + DirtyFileSystem, /// There is not enough free space on the storage to finish the requested operation. NotEnoughSpace, /// The provided file name is either too long or empty. @@ -47,7 +49,7 @@ impl From> for std::io::Error { | Error::DirectoryIsNotEmpty => Self::new(std::io::ErrorKind::InvalidInput, error), Error::NotFound => Self::new(std::io::ErrorKind::NotFound, error), Error::AlreadyExists => Self::new(std::io::ErrorKind::AlreadyExists, error), - Error::CorruptedFileSystem => Self::new(std::io::ErrorKind::InvalidData, error), + Error::CorruptedFileSystem | Error::DirtyFileSystem => Self::new(std::io::ErrorKind::InvalidData, error), } } } @@ -66,6 +68,7 @@ impl core::fmt::Display for Error { Error::NotFound => write!(f, "No such file or directory"), Error::AlreadyExists => write!(f, "File or directory already exists"), Error::CorruptedFileSystem => write!(f, "Corrupted file system"), + Error::DirtyFileSystem => write!(f, "Dirty file system"), } } }