diff options
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs index 20563b1..88f2713 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,6 +1,20 @@ use reqwest::Error as ReqwestError; +use futures::future::SharedError; use std::convert::From; +/*TODO: How should condition errors be handled? + * Ultimately the future must resolve so if the condition + * errs than all it's waiters must err. + */ +#[derive(Clone, Debug)] +pub struct ConditionError{} + +impl From<SharedError<ConditionError>> for ConditionError { + fn from(other: SharedError<ConditionError>) -> Self { + ConditionError{} + } +} + #[derive(Debug)] enum Kind { Reqwest(ReqwestError), @@ -50,3 +64,12 @@ impl<T> From<SendError<T>> for Error { } } } + +impl From<ConditionError> for Error { + + fn from(_err: ConditionError) -> Error { + Error { + inner: Kind::ClientError("Oneshot channel unexpectedly closed".to_owned()) + } + } +} |