diff --git a/crates/matrix-sdk/src/client/mod.rs b/crates/matrix-sdk/src/client/mod.rs index 85b077b45..59e35eb29 100644 --- a/crates/matrix-sdk/src/client/mod.rs +++ b/crates/matrix-sdk/src/client/mod.rs @@ -2448,12 +2448,13 @@ impl Client { C: Future, { self.sync_with_result_callback(sync_settings, |result| async { - if let Ok(sync_response) = result { - callback(sync_response).await - } else { - warn!("Error from sync with result: {}", result.err().unwrap()); - // do not make a decision about control loop by default - LoopCtrl::Continue + match result { + Ok(sync_response) => callback(sync_response).await, + Err(e) => { + warn!("Error from sync with result: {e}"); + // continue the loop in case of error + LoopCtrl::Continue + } } }) .await;