1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-28 12:02:00 +03:00

update array_index() and add testcases

This commit is contained in:
chenguoping
2020-03-25 15:56:45 +08:00
parent dcd3a6c62b
commit e07686f0c7
3 changed files with 32 additions and 4 deletions

View File

@ -10423,9 +10423,9 @@ class json_pointer
{
res = std::stoi(s, &processed_chars);
}
JSON_CATCH(std::invalid_argument&)
JSON_CATCH(std::out_of_range&)
{
JSON_THROW(detail::parse_error::create(109, 0, "array index '" + s + "' is not a number"));
JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + s + "'"));
}
// check if the string was completely read