Skip to content
Snippets Groups Projects
Commit 7898e200 authored by Federico Montesino Pouzols's avatar Federico Montesino Pouzols
Browse files

check retval from json parser + fix test example, 1311473, re #13951

parent 4c02d874
No related branches found
No related tags found
No related merge requests found
......@@ -107,7 +107,14 @@ void CheckMantidVersion::exec() {
if (!json.empty()) {
Json::Reader r;
Json::Value root;
r.parse(json, root);
bool parseOK = r.parse(json, root);
if (!parseOK) {
g_log.error() << "Error trying to parse this JSON string from GitHub: "
<< json << std::endl;
throw std::runtime_error("Error found when parsing version information "
"retrieved from GitHub as a JSON string." +
r.getFormattedErrorMessages());
}
std::string gitHubVersionTag = root["tag_name"].asString();
mostRecentVersion = cleanVersionTag(gitHubVersionTag);
......
......@@ -77,7 +77,8 @@ private:
"\"https://api.github.com/users/peterfpeterson/received_events\",\n"
" \"type\": \"User\",\n"
" \"site_admin\": false\n"
" }";
" }\n"
"}";
return outputString;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment