use alloc::string::String;
use derive_more::derive::Display;
use crate::file::Type;
#[allow(clippy::module_name_repetitions)]
#[derive(Debug, Display)]
#[display("FileSystem Error: {_variant}")]
pub enum FsError<E: core::error::Error> {
#[display("Entry Already Exist: \"{_0}\" already exist in given directory")]
EntryAlreadyExist(String),
#[display("Implementation: {_0}")]
Implementation(E),
#[display("Loop: a loop has been encountered during the resolution of \"{_0}\"")]
Loop(String),
#[display("Name too long: \"{_0}\" is too long to be resolved")]
NameTooLong(String),
#[display("Not a Directory: \"{_0}\" is not a directory")]
NotDir(String),
#[display("No Entry: \"{_0}\" is an symbolic link pointing at an empty string")]
NoEnt(String),
#[display("Not Found: \"{_0}\" has not been found")]
NotFound(String),
#[display("Remove Refused: Tried to remove the current directory or a parent directory, which is not permitted")]
RemoveRefused,
#[display("Wrong File Type: {expected:?} file type expected, {given:?} given")]
WrongFileType {
expected: Type,
given: Type,
},
}
impl<FSE: core::error::Error> core::error::Error for FsError<FSE> {}