use std::any::Any;
use thiserror::Error;
pub type Result<T, E = JoinError> = std::result::Result<T, E>;
#[derive(Debug, Error)]
pub enum JoinError {
#[error("no thread was available to be joined")]
NoHandleFound,
#[error("the joined thread panicked before exiting normally")]
ThreadPanic(Box<dyn Any + Send + 'static>),
}