use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error("Represents a None Option value as an error.")]
None,
#[error("The file name ends in \"..\", and does therefore not represent a file.")]
PathNotAFile,
#[error(
"The string is not valid UTF-8, and can thus not be represented by a normal rust string."
)]
NotValidUtf8,
#[error(transparent)]
IO(#[from] std::io::Error),
#[error(transparent)]
Boxed(#[from] Box<dyn std::error::Error + Send + Sync>),
#[error("{0}")]
Message(String),
}
#[cfg(test)]
mod tests {
use super::*;
use crate::util::test::is_good_error;
#[test]
fn normal_types() {
is_good_error::<Error>();
}
}