summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorDavid Blajda <blajda@hotmail.com>2018-12-20 00:09:49 +0000
committerDavid Blajda <blajda@hotmail.com>2018-12-20 00:09:49 +0000
commit61507ec1fa61fe134547a7eac9541375c6215b33 (patch)
treecf7fb84300454680dd0acd06434fa23a71d6211f /src/error.rs
parenta8e42248cf617767dfd890c0832ea233bb4608fc (diff)
Replace channel based barrier with shared future based barrier
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs23
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())
+ }
+ }
+}