summaryrefslogtreecommitdiffstats
path: root/src/fail.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/fail.rs')
-rw-r--r--src/fail.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/fail.rs b/src/fail.rs
index 38a66d0..1abdea7 100644
--- a/src/fail.rs
+++ b/src/fail.rs
@@ -30,6 +30,8 @@ pub enum HError {
ChannelRecvError{#[cause] error: std::sync::mpsc::RecvError},
#[fail(display = "Channel failed")]
ChannelSendError,
+ #[fail(display = "Timer ran out while waiting for message on channel!")]
+ ChannelRecvTimeout(#[cause] std::sync::mpsc::RecvTimeoutError),
#[fail(display = "Previewer failed on file: {}", file)]
PreviewFailed{file: String},
#[fail(display = "StalePreviewer for file: {}", file)]
@@ -292,6 +294,13 @@ impl From<std::sync::mpsc::RecvError> for HError {
}
}
+impl From<std::sync::mpsc::RecvTimeoutError> for HError {
+ fn from(error: std::sync::mpsc::RecvTimeoutError) -> Self {
+ let err = HError::ChannelRecvTimeout(error);
+ err
+ }
+}
+
impl<T> From<std::sync::mpsc::SendError<T>> for HError {
fn from(_error: std::sync::mpsc::SendError<T>) -> Self {
let err = HError::ChannelSendError;