]> git.proxmox.com Git - proxmox-backup.git/commitdiff
src/client/http_client.rs - start_h2_connection: correctly return error during upgrade
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 27 Dec 2019 12:41:31 +0000 (13:41 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 27 Dec 2019 12:41:31 +0000 (13:41 +0100)
src/client/http_client.rs

index ad46eae3f34024e19b1dc70eb3d3573eb5b8f3f3..2705291762f45dd9da7061be6f399dd2f31a4329 100644 (file)
@@ -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