1use std::io::Error as IoError;
6use thiserror::Error;
7use toml::{de::Error as ParserError, ser::Error as SerializerError};
8
9#[derive(Debug, Error)]
17pub enum ConfigError {
18 #[error("An error occured in an I/O operation; error: {0}")]
19 Io(#[from] IoError),
20
21 #[error("Could not determine the location of the configuration directory.")]
22 ConfigDir,
23
24 #[error("An error occured parsing the configuration file; error {0}")]
25 Parser(#[from] ParserError),
26
27 #[error("An error occured serializing the configuration file; error {0}")]
28 Serializer(#[from] SerializerError),
29}
30
31pub type ConfigResult<T> = std::result::Result<T, ConfigError>;