From ca6119551d8fe9303fe784416a7b3cd544e03bc4 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 27 Dec 2019 13:41:31 +0100 Subject: [PATCH] src/client/http_client.rs - start_h2_connection: correctly return error during upgrade --- src/client/http_client.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/client/http_client.rs b/src/client/http_client.rs index ad46eae3..27052917 100644 --- a/src/client/http_client.rs +++ b/src/client/http_client.rs @@ -299,10 +299,8 @@ impl HttpClient { let status = resp.status(); if status != http::StatusCode::SWITCHING_PROTOCOLS { - Self::api_response(resp) - .map(|_| Err(format_err!("unknown error"))) - .await?; - unreachable!(); + Self::api_response(resp).await?; + bail!("unknown error"); } let upgraded = resp