nlohmann::detail::type_error: [json.exception.type_error.302 #3510
Replies: 2 comments 4 replies
-
You can use Also note a type error (302) is not thrown when a key is missing, but rather when you were able to retrieve a key, but the value type is not fitting the receiver type. |
Beta Was this translation helpful? Give feedback.
-
I got the same error but I want different behavior, e.g., how to handle
Those
So, should I check if the disable or enable is null with |
Beta Was this translation helpful? Give feedback.
-
This might be a simple question.
When I receive a json object and try to read a field in this object but that field doesn't exist, I get nlohmann::detail::type_error: [json.exception.type_error.302]
Is there any way to just get null or something like that instead of "terminating with uncaught exception"? Is there any error handler example available?
Example:
Many thanks!
Mo
Beta Was this translation helpful? Give feedback.
All reactions