diff options
Diffstat (limited to 'src/errors.rs')
-rw-r--r-- | src/errors.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/errors.rs b/src/errors.rs index be78bcf..9f570d2 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,5 +1,7 @@ +use std::io; use std::num::ParseIntError; use ical::parser; +use toml; #[derive(Debug)] pub enum EventError { @@ -20,3 +22,22 @@ impl From<ParseIntError> for EventError { EventError::IntError(err) } } + +#[derive(Debug)] +pub enum ConfigError { + IOError(io::Error), + ParseError(toml::de::Error), + MissingPath, +} + +impl From<io::Error> for ConfigError { + fn from(err: io::Error) -> ConfigError { + ConfigError::IOError(err) + } +} + +impl From<toml::de::Error> for ConfigError { + fn from(err: toml::de::Error) -> ConfigError { + ConfigError::ParseError(err) + } +} |