diff options
author | rabite <rabite@posteo.de> | 2020-02-05 21:45:51 +0100 |
---|---|---|
committer | rabite <rabite@posteo.de> | 2020-02-05 21:45:51 +0100 |
commit | a6c829e1439dd1a50eb3de090bb13990a1eaf932 (patch) | |
tree | 5fd5c7b6474c07d041d3c8d09a06b631b2c7738e /src/fail.rs | |
parent | aa091b69c8faddc9515a47ad8e66d4c89a91ac05 (diff) |
buggy super-fast crazy stuffbuggy-speed
Diffstat (limited to 'src/fail.rs')
-rw-r--r-- | src/fail.rs | 9 |
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; |