From 97f6d48c4240859a981ea994840fc68000514a43 Mon Sep 17 00:00:00 2001 From: sigoden Date: Mon, 29 Apr 2024 23:09:19 +0000 Subject: refactor: check res status code --- src/client/qianwen.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/client/qianwen.rs') diff --git a/src/client/qianwen.rs b/src/client/qianwen.rs index 1f42fd9..2f298c3 100644 --- a/src/client/qianwen.rs +++ b/src/client/qianwen.rs @@ -298,7 +298,7 @@ async fn upload(model: &str, api_key: &str, url: &str) -> Result { let res = client.post(upload_host).multipart(form).send().await?; let status = res.status(); - if res.status() != 200 { + if !status.is_success() { let text = res.text().await?; bail!("Invalid response data: {text} (status: {status})") } -- cgit v1.2.3