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, });