chore(rp): Simplify error handling in exchange()

This commit is contained in:
Karolin Varner
2025-08-02 18:34:28 +02:00
parent 41eb620751
commit 6c929f7ddc

View File

@@ -530,24 +530,5 @@ pub async fn exchange(options: ExchangeOptions) -> Result<()> {
}
log::info!("Starting to perform rosenpass key exchanges!");
let out = srv.event_loop();
match out {
Ok(_) => Ok(()),
Err(e) => {
// Check if the returned error is actually EINTR, in which case, the run actually
// succeeded.
let is_ok = if let Some(e) = e.root_cause().downcast_ref::<std::io::Error>() {
matches!(e.kind(), std::io::ErrorKind::Interrupted)
} else {
false
};
if is_ok {
Ok(())
} else {
Err(e)
}
}
}
srv.event_loop()
}