Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Commit

Permalink
simplify join_err handling
Browse files Browse the repository at this point in the history
  • Loading branch information
xvello committed May 6, 2024
1 parent 915f624 commit 61c0516
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions hook-worker/src/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,9 @@ impl Resolve for PublicIPv4Resolver {
Err(err)
}
Err(join_err) => {
// The tokio task failed, error handled copied from hyper's GaiResolver
if join_err.is_cancelled() {
let err: BoxError =
Box::new(io::Error::new(io::ErrorKind::Interrupted, join_err));
Err(err)
} else {
panic!("background task failed: {:?}", join_err)
}
// The tokio task failed, pass as io::Error in a Box
let err: BoxError = Box::new(io::Error::from(join_err));
Err(err)
}
});

Expand Down

0 comments on commit 61c0516

Please sign in to comment.