From 3b82a350ed2e567e9e6e0ddfdd688c6625128be6 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sat, 22 Jun 2019 09:44:12 +0200 Subject: [PATCH] :memo: mention 302 exception in value() documentation #1601 --- include/nlohmann/json.hpp | 4 ++++ single_include/nlohmann/json.hpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index daaf2d661c..58db19d701 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -3388,6 +3388,8 @@ class basic_json @return copy of the element at key @a key or @a default_value if @a key is not found + @throw type_error.302 if @a default_value does not match the type of the + value at @a key @throw type_error.306 if the JSON value is not an object; in that case, using `value()` with a key makes no sense. @@ -3461,6 +3463,8 @@ class basic_json @return copy of the element at key @a key or @a default_value if @a key is not found + @throw type_error.302 if @a default_value does not match the type of the + value at @a ptr @throw type_error.306 if the JSON value is not an object; in that case, using `value()` with a key makes no sense. diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 08ac166bdb..bb2dacbc21 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -16189,6 +16189,8 @@ class basic_json @return copy of the element at key @a key or @a default_value if @a key is not found + @throw type_error.302 if @a default_value does not match the type of the + value at @a key @throw type_error.306 if the JSON value is not an object; in that case, using `value()` with a key makes no sense. @@ -16262,6 +16264,8 @@ class basic_json @return copy of the element at key @a key or @a default_value if @a key is not found + @throw type_error.302 if @a default_value does not match the type of the + value at @a ptr @throw type_error.306 if the JSON value is not an object; in that case, using `value()` with a key makes no sense.