go_spawn/
error.rs

1use std::any::Any;
2use thiserror::Error;
3
4pub type Result<T, E = JoinError> = std::result::Result<T, E>;
5
6#[derive(Debug, Error)]
7pub enum JoinError {
8    /// Indicates that no thread was available to be joined.
9    #[error("no thread was available to be joined")]
10    NoHandleFound,
11
12    /// Indicates that the joined thread panicked with the given value.
13    #[error("the joined thread panicked before exiting normally")]
14    ThreadPanic(Box<dyn Any + Send + 'static>),
15}