Skip to content

Commit 4c06dca

Browse files
committed
feat: Add the error text to json type errors in json_value
Branch: gabe-l-hart/thinking-model-disabled-agent-prefill Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
1 parent 7cf5963 commit 4c06dca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/server/utils.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ static T json_value(const json & body, const std::string & key, const T & defaul
5454
if (body.contains(key) && !body.at(key).is_null()) {
5555
try {
5656
return body.at(key);
57-
} catch (NLOHMANN_JSON_NAMESPACE::detail::type_error const &) {
58-
LOG_WRN("Wrong type supplied for parameter '%s'. Expected '%s', using default value\n", key.c_str(), json(default_value).type_name());
57+
} catch (NLOHMANN_JSON_NAMESPACE::detail::type_error const & err) {
58+
LOG_WRN("Wrong type supplied for parameter '%s'. Expected '%s', using default value: %s\n", key.c_str(), json(default_value).type_name(), err.what());
5959
return default_value;
6060
}
6161
} else {

0 commit comments

Comments
 (0)