harden a bit

This commit is contained in:
Xuan Son Nguyen
2026-08-22 10:08:39 +02:00
parent cdcd63bc03
commit b89d589040
4 changed files with 64 additions and 18 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ static T json_value(const json & body, const std::string & key, const T & defaul
if (body.contains(key) && !body.at(key).is_null()) {
try {
return body.at(key).get<T>();
} catch (const std::exception & err) {
} catch (const common_json_error & err) {
LOG_WRN("Wrong type supplied for parameter '%s', using default value: %s\n", key.c_str(), err.what());
return default_value;
}