diff --git a/src/helpers/auto_abort_join_handle.rs b/src/helpers/auto_abort_join_handle.rs index 8faa1f25..669f352a 100644 --- a/src/helpers/auto_abort_join_handle.rs +++ b/src/helpers/auto_abort_join_handle.rs @@ -5,7 +5,9 @@ use std::{ task::{Context, Poll}, }; -use tokio::task::{JoinError, JoinHandle}; +use tokio::task::JoinHandle; + +use super::BinstallError; #[derive(Debug)] pub struct AutoAbortJoinHandle(JoinHandle); @@ -49,9 +51,11 @@ impl DerefMut for AutoAbortJoinHandle { } impl Future for AutoAbortJoinHandle { - type Output = Result; + type Output = Result; fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - Pin::new(&mut Pin::into_inner(self).0).poll(cx) + Pin::new(&mut Pin::into_inner(self).0) + .poll(cx) + .map(|res| res.map_err(BinstallError::TaskJoinError)) } }