diff --git a/src/archive.cpp b/src/archive.cpp index 405ea02..fa5806e 100644 --- a/src/archive.cpp +++ b/src/archive.cpp @@ -99,12 +99,17 @@ void archive::parse_json(const std::string& json_data) { // Process all keys in the JSON object for (auto& [key, value] : data.items()) { - if (json_map.find(key) != json_map.end()) { - json_map[key](value); - json_map.erase(key); - } else if (readonly_map.find(key) != readonly_map.end()) { - readonly_map[key](value); - readonly_map.erase(key); + try { + if (json_map.find(key) != json_map.end()) { + json_map[key](value); + json_map.erase(key); + } else if (readonly_map.find(key) != readonly_map.end()) { + readonly_map[key](value); + readonly_map.erase(key); + } + } catch (const std::exception& e) { + std::cerr << "Unexpected error during JSON parsing: " << e.what() << std::endl; + continue; } }