backie/src/blocking/error.rs
Pmarquez 360140d064
Blocking refactor (#74)
* 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>
2022-08-29 16:59:22 +00:00

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
}
}