pub fn from_panic(panic_msg: Box<dyn Any>) -> Self {
        let err_msg = if let Some(msg) = panic_msg.downcast_ref::<String>() {
            msg.as_ref()
        } else if let Some(msg) = panic_msg.downcast_ref::<&str>() {
            msg
        } else {
            "unknown cause"
        };

        let kind = if err_msg.contains("PoisonError") {
            ErrorKind::PoisonError
        } else {
            ErrorKind::PanicError
        };

        err!(kind, err_msg).into()
    }
/// Create an error from a panic
Create an error from a panic
Create an error from a panic
pub fn from_panic(panic_msg: Box<dyn Any>) -> Self {
        let err_msg = if let Some(msg) = panic_msg.downcast_ref::<String>() {
            msg.as_ref()
        } else if let Some(msg) = panic_msg.downcast_ref::<&str>() {
            msg
        } else {
            "unknown cause"
        };
        let kind = if err_msg.contains("PoisonError") {
            ErrorKind::PoisonError
        } else {
            ErrorKind::PanicError
        };
        err!(kind, err_msg).into()
    }
pub fn from_panic ( panic_msg : Box < dyn Any > ) -> Self { let err_msg = if let Some ( msg ) = panic_msg . downcast_ref :: < String > ( ) { msg . as_ref ( ) } else if let Some ( msg ) = panic_msg . downcast_ref :: < & str > ( ) { msg } else { " " } ; let kind = if err_msg . contains ( " " ) { ErrorKind :: PoisonError } else { ErrorKind :: PanicError } ; err ! ( kind err_msg ) . into ( ) }
Create an error from a panic
Create an error from a panic
panic_msg
Box<dyn Any>