Skip to content

Commit

Permalink
Updated exception handling to catch const reference in out_of_range (#…
Browse files Browse the repository at this point in the history
…4331)

Co-authored-by: LeilaSh <[email protected]>
  • Loading branch information
LeilaShcheglova and LeilaShcheglova committed Apr 8, 2024
1 parent 16b3d84 commit 377c767
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/examples/at__keytype_const.c++17.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down

0 comments on commit 377c767

Please sign in to comment.