Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

Commit 03a896f

Browse files
authored
Merge pull request #62 from cyanray/dev/cyanray
修复: 未对GetGroupMemberInfo查找失败的情况进行处理
2 parents d0c3cd2 + 4063068 commit 03a896f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/mirai_bot.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ namespace Cyan
359359
if (res->status != 200)
360360
throw std::runtime_error("[mirai-api-http error]: " + res->body);
361361
json re_json = json::parse(res->body);
362+
if (re_json.find("code") != re_json.end())
363+
{
364+
throw std::runtime_error(re_json["msg"]);
365+
}
362366
GroupMemberInfo result;
363367
result.Set(re_json);
364368
return result;

0 commit comments

Comments
 (0)