diff options
author | Ruben Pollan | 2018-12-10 18:23:29 +0100 |
---|---|---|
committer | Ruben Pollan | 2018-12-10 18:23:29 +0100 |
commit | 8a15ad89d7df16c9a82721bae1e9ba8d5ab02dd2 (patch) | |
tree | f0227e4b94d125f7237952c0aae6355bf05285f8 /src/errors.rs | |
parent | dc2d46735deaa2a8ba78702d5dd033f309fcfb0c (diff) |
Add config file
Diffstat (limited to '')
-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) + } +} |