use std::result;
use std::sync::PoisonError;
use std::fmt;
use std::error;
#[derive(Debug)]
pub struct Error;
impl error::Error for Error {
fn description(&self) -> &str {
"One of the hive's workers panicked."
}
fn cause(&self) -> Option<&error::Error> {
None
}
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "One of the hive's workers panicked.")
}
}
impl<T> From<PoisonError<T>> for Error {
fn from(_: PoisonError<T>) -> Error {
Error
}
}
pub type Result<T> = result::Result<T, Error>;