From 377c767aa19da7159cf537490bc33da96edf8803 Mon Sep 17 00:00:00 2001 From: Leila Shcheglova <119249992+LeilaShcheglova@users.noreply.github.com> Date: Tue, 9 Apr 2024 02:12:32 +0700 Subject: [PATCH] Updated exception handling to catch const reference in out_of_range (#4331) Co-authored-by: LeilaSh --- docs/examples/at__keytype_const.c++17.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/at__keytype_const.c++17.cpp b/docs/examples/at__keytype_const.c++17.cpp index b08cd17b5..712d456e6 100644 --- a/docs/examples/at__keytype_const.c++17.cpp +++ b/docs/examples/at__keytype_const.c++17.cpp @@ -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'; }