qorb 0.4.1

Connection Pooling
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Helpers for joining terminating tasks

use tokio::task::JoinError;

pub(crate) fn propagate_panics(result: Result<(), JoinError>) {
    match result {
        // Success or cancellation: Quietly return
        Ok(()) => (),
        Err(err) if err.is_cancelled() => (),
        // Propagate panics
        Err(err) if err.is_panic() => {
            std::panic::panic_any(err.into_panic());
        }
        Err(err) => {
            panic!("Unexpected join error (other than panic or cancellation): {err}");
        }
    }
}