From 26ddc4889560ea1e63e7fec674fbd87bb394acfb Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Sun, 29 Apr 2018 20:10:43 +0200 Subject: Add Events type --- src/errors.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/errors.rs (limited to 'src/errors.rs') 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 for EventError { + fn from(err: parser::errors::Error) -> EventError { + EventError::IcalError(err) + } +} + +impl From for EventError { + fn from(err: ParseIntError) -> EventError { + EventError::IntError(err) + } +} -- cgit v1.2.3