diff options
author | Ruben Pollan | 2018-04-29 20:10:43 +0200 |
---|---|---|
committer | Ruben Pollan | 2018-04-29 20:10:43 +0200 |
commit | 26ddc4889560ea1e63e7fec674fbd87bb394acfb (patch) | |
tree | bb5c0d00bc4827c8be5c4a1c376f6e7421dadb11 /src/errors.rs | |
parent | 7a90f7f4cdfc53b65d30df806de0a26ca6b86b8c (diff) |
Add Events type
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 new file mode 100644 index 0000000..d526bae --- /dev/null +++ b/src/errors.rs @@ -0,0 +1,21 @@ +use std::num::ParseIntError; +use ical::parser; + +#[derive(Debug)] +pub enum EventError { + IcalError(parser::errors::Error), + IntError(ParseIntError), + StatusError, +} + +impl From<parser::errors::Error> for EventError { + fn from(err: parser::errors::Error) -> EventError { + EventError::IcalError(err) + } +} + +impl From<ParseIntError> for EventError { + fn from(err: ParseIntError) -> EventError { + EventError::IntError(err) + } +} |