summaryrefslogtreecommitdiffstats
path: root/src/client/qianwen.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-04-29 23:09:19 +0000
committersigoden <sigoden@gmail.com>2024-04-29 23:09:19 +0000
commit97f6d48c4240859a981ea994840fc68000514a43 (patch)
treec5b36a950797990367415b71d304d9cc1013f92b /src/client/qianwen.rs
parent50eac8b59409f73655fc2b8cf8d783c6347209c3 (diff)
downloadaichat-97f6d48c4240859a981ea994840fc68000514a43.tar.gz
refactor: check res status code
Diffstat (limited to 'src/client/qianwen.rs')
-rw-r--r--src/client/qianwen.rs2
1 files changed, 1 insertions, 1 deletions
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<String> {
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})")
}