diff --git a/hammond-data/src/errors.rs b/hammond-data/src/errors.rs index 689ee91..e4237fc 100644 --- a/hammond-data/src/errors.rs +++ b/hammond-data/src/errors.rs @@ -46,6 +46,10 @@ pub enum DataError { }, #[fail(display = "Error occured while Parsing an Episode. Reason: {}", reason)] ParseEpisodeError { reason: String, parent_id: i32 }, + #[fail(display = "No Futures where produced to be run.")] + EmptyFuturesList, + #[fail(display = "Episode was not changed and thus skipped.")] + EpisodeNotChanged, } impl From for DataError { diff --git a/hammond-data/src/feed.rs b/hammond-data/src/feed.rs index c5797b3..151234d 100644 --- a/hammond-data/src/feed.rs +++ b/hammond-data/src/feed.rs @@ -96,7 +96,7 @@ impl Feed { // I am not sure what the optimizations are on match vs allocating None. .map(|fut| { fut.and_then(|x| match x { - IndexState::NotChanged => return Err(DataError::DiscountBail(format!("Nothing to do here."))), + IndexState::NotChanged => return Err(DataError::EpisodeNotChanged), _ => Ok(x), }) }) diff --git a/hammond-data/src/lib.rs b/hammond-data/src/lib.rs index 5fbcd49..3fbbadc 100644 --- a/hammond-data/src/lib.rs +++ b/hammond-data/src/lib.rs @@ -27,7 +27,7 @@ extern crate derive_builder; extern crate diesel; #[macro_use] extern crate diesel_migrations; -#[macro_use] +// #[macro_use] extern crate failure; #[macro_use] extern crate failure_derive; diff --git a/hammond-data/src/pipeline.rs b/hammond-data/src/pipeline.rs index e7915a1..893bc23 100644 --- a/hammond-data/src/pipeline.rs +++ b/hammond-data/src/pipeline.rs @@ -58,9 +58,7 @@ pub fn pipeline>( .collect(); if list.is_empty() { - return Err(DataError::DiscountBail(format!( - "No futures were found to run." - ))); + return Err(DataError::EmptyFuturesList); } // Thats not really concurrent yet I think.