Make things work #1

Merged
etenie merged 10 commits from fix-regex into master 2024-11-10 18:35:45 +00:00
1 changed files with 2 additions and 2 deletions
Showing only changes of commit 377383d5a0 - Show all commits

View File

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