diff --git a/src/api/appservice_server.rs b/src/api/appservice_server.rs index 6ea4330f..f9807846 100644 --- a/src/api/appservice_server.rs +++ b/src/api/appservice_server.rs @@ -79,7 +79,7 @@ where Vec::new().into() }); // TODO: handle timeout - if status != 200 { + if !status.is_success() { warn!( "Appservice returned bad response {} {}\n{}\n{:?}", destination, diff --git a/src/api/server_server.rs b/src/api/server_server.rs index ae100248..754008b3 100644 --- a/src/api/server_server.rs +++ b/src/api/server_server.rs @@ -267,7 +267,7 @@ where }); // TODO: handle timeout debug!("Got response bytes from {destination}"); - if status != 200 { + if !status.is_success() { warn!( "{} {}: {}", url, @@ -283,7 +283,7 @@ where .body(body) .expect("reqwest body is valid http body"); - if status == 200 { + if status.is_success() { debug!("Parsing response bytes from {destination}"); let response = T::IncomingResponse::try_from_http_response(http_response); if response.is_ok() && write_destination_to_cache { diff --git a/src/service/pusher/mod.rs b/src/service/pusher/mod.rs index b0dbbe9e..cf0eda83 100644 --- a/src/service/pusher/mod.rs +++ b/src/service/pusher/mod.rs @@ -97,7 +97,7 @@ impl Service { Vec::new().into() }); // TODO: handle timeout - if status != 200 { + if !status.is_success() { info!( "Push gateway returned bad response {} {}\n{}\n{:?}", destination,