Fix the parser check

This commit is contained in:
:^) 2024-11-11 14:48:23 +01:00
parent 0187c45f8e
commit 3426c801c9
Signed by: etenie
GPG Key ID: 9BBC40007AE916C1
1 changed files with 1 additions and 1 deletions

View File

@ -76,7 +76,7 @@ private:
glz::json_t json{};
auto ec = glz::read_json(json, response.text);
if (ec != glz::error_code::parse_error && json["queryresult"]["success"].get_boolean()) {
if (ec == glz::error_code::none && json["queryresult"]["success"].get_boolean()) {
return json["queryresult"]["pods"][1]["subpods"][0]["plaintext"].get<std::string>();
} else {
throw std::invalid_argument("WolframAlpha query failed");