1use std::fmt;
2use std::io;
3
4#[derive(Debug)]
5pub enum Error {
6 IoError(io::Error),
7 FormatError(String),
8 TransformationError(String),
9 OutputError(io::Error),
10}
11
12impl fmt::Display for Error {
13 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
14 match self {
15 Error::IoError(err) => write!(f, "IO Error: {}", err),
16 Error::FormatError(msg) => write!(f, "Format Error: {}", msg),
17 Error::TransformationError(msg) => write!(f, "Transformation Error: {}", msg),
18 Error::OutputError(err) => write!(f, "Output Error: {}", err),
19 }
20 }
21}
22
23impl std::error::Error for Error {}