From e3154d35a78b7513f945f85aaf8f51e72d04f1b1 Mon Sep 17 00:00:00 2001 From: "Jiwei,Yuan" Date: Mon, 27 Apr 2026 15:50:36 +0100 Subject: [PATCH] =?UTF-8?q?chore(rust):=20release=200.3.2=20=E2=80=94=20un?= =?UTF-8?q?ify=20error=20message=20extraction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bump version to 0.3.2 and align the status>=400 error branch with the new errcode check branch so both use the errmsg→message→raw fallback. Co-Authored-By: Claude Opus 4.6 (1M context) --- rust/Cargo.lock | 2 +- rust/Cargo.toml | 2 +- rust/src/protocol.rs | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index d06e862..2fa515e 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -1764,7 +1764,7 @@ dependencies = [ [[package]] name = "wechatbot" -version = "0.3.1" +version = "0.3.2" dependencies = [ "aes", "base64", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 801c187..27cb736 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wechatbot" -version = "0.3.1" +version = "0.3.2" edition = "2021" description = "WeChat iLink Bot SDK for Rust" license = "MIT" diff --git a/rust/src/protocol.rs b/rust/src/protocol.rs index f5c6059..3766686 100644 --- a/rust/src/protocol.rs +++ b/rust/src/protocol.rs @@ -224,7 +224,11 @@ impl ILinkClient { if status >= 400 { return Err(WeChatBotError::Api { - message: value["errmsg"].as_str().unwrap_or(&text).to_string(), + message: value["errmsg"] + .as_str() + .or_else(|| value["message"].as_str()) + .unwrap_or(&text) + .to_string(), http_status: status, errcode: value["errcode"].as_i64().unwrap_or(0) as i32, });