From 8daa12ac56cdb092f53496d49907019606b268ac Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Fri, 10 Jul 2020 10:21:41 +0200 Subject: [PATCH] Print error when receiving invalid response in sync_forever. --- matrix_sdk/src/client.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/matrix_sdk/src/client.rs b/matrix_sdk/src/client.rs index be083ad1..f06663ae 100644 --- a/matrix_sdk/src/client.rs +++ b/matrix_sdk/src/client.rs @@ -30,8 +30,7 @@ use matrix_sdk_common::uuid::Uuid; use futures_timer::Delay as sleep; use std::future::Future; #[cfg(feature = "encryption")] -use tracing::{debug, warn}; -use tracing::{info, instrument, trace}; +use tracing::{debug, error, info, instrument, trace, warn}; use http::Method as HttpMethod; use http::Response as HttpResponse; @@ -1294,6 +1293,9 @@ impl Client { let response = if let Ok(r) = response { r } else { + let err = response.unwrap_err(); + error!("Received an invalid response: {}", err); + sleep::new(Duration::from_secs(1)).await; continue;