2022-08-29 16:59:22 +00:00
|
|
|
use crate::blocking::queue::QueueError;
|
2021-12-05 06:19:08 +00:00
|
|
|
use std::io::Error as IoError;
|
|
|
|
use std::sync::PoisonError;
|
|
|
|
use thiserror::Error;
|
|
|
|
|
|
|
|
#[derive(Error, Debug)]
|
|
|
|
pub enum FangError {
|
|
|
|
#[error("The shared state in an executor thread became poisoned")]
|
|
|
|
PoisonedLock,
|
2022-08-29 16:59:22 +00:00
|
|
|
#[error(transparent)]
|
|
|
|
QueueError(#[from] QueueError),
|
2021-12-05 06:19:08 +00:00
|
|
|
#[error("Failed to create executor thread")]
|
|
|
|
ExecutorThreadCreationFailed {
|
|
|
|
#[from]
|
|
|
|
source: IoError,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T> From<PoisonError<T>> for FangError {
|
|
|
|
fn from(_: PoisonError<T>) -> Self {
|
|
|
|
Self::PoisonedLock
|
|
|
|
}
|
|
|
|
}
|