360140d064
* Adapting code to new Fang tables structure and refactoring to make it more generic (Not finished) * Refactoring of the blocking module * Finishing blocking module, starting to modify tests * Worker tests done, Queue tests left * Maybe all tests done ?? * Makefile clippy * Examples fixed * asynk feature Co-authored-by: Ayrat Badykov <ayratin555@gmail.com>
24 lines
574 B
Rust
24 lines
574 B
Rust
use crate::blocking::queue::QueueError;
|
|
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,
|
|
#[error(transparent)]
|
|
QueueError(#[from] QueueError),
|
|
#[error("Failed to create executor thread")]
|
|
ExecutorThreadCreationFailed {
|
|
#[from]
|
|
source: IoError,
|
|
},
|
|
}
|
|
|
|
impl<T> From<PoisonError<T>> for FangError {
|
|
fn from(_: PoisonError<T>) -> Self {
|
|
Self::PoisonedLock
|
|
}
|
|
}
|