mirror of
https://github.com/nlohmann/json
synced 2024-11-21 19:50:04 +00:00
Updated exception handling to catch const reference in out_of_range (#4331)
Co-authored-by: LeilaSh <leilanagieva81@gmail.com>
This commit is contained in:
parent
16b3d841d5
commit
377c767aa1
@ -36,7 +36,7 @@ int main()
|
||||
// try to read from a nonexisting key using string_view
|
||||
std::cout << object.at("the fast"sv) << '\n';
|
||||
}
|
||||
catch (const json::out_of_range)
|
||||
catch (const json::out_of_range& e)
|
||||
{
|
||||
std::cout << "out of range" << '\n';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user