File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 3737#include < chrono>
3838#include < sstream>
3939#include < filesystem>
40- #include < unordered_set>
4140// boost
4241#include < boost/property_tree/json_parser.hpp>
42+ #include < boost/property_tree/json_parser/error.hpp>
4343#include < boost/property_tree/ptree.hpp>
4444#include < boost/foreach.hpp>
4545#include < utility>
@@ -568,7 +568,10 @@ boost::property_tree::ptree CcdbDatabase::getListingAsPtree(const std::string& p
568568 std::stringstream listingAsStringStream{ getListingAsString (pathWithMetadata.str (), " application/json" , latestOnly) };
569569
570570 boost::property_tree::ptree listingAsTree;
571- boost::property_tree::read_json (listingAsStringStream, listingAsTree);
571+ try {
572+ boost::property_tree::read_json (listingAsStringStream, listingAsTree);
573+ } catch (const boost::property_tree::json_parser::json_parser_error&) {
574+ }
572575
573576 return listingAsTree;
574577}
@@ -616,7 +619,11 @@ std::vector<std::string> CcdbDatabase::getPublishedObjectNames(std::string taskN
616619 boost::property_tree::ptree pt;
617620 stringstream ss;
618621 ss << listing;
619- boost::property_tree::read_json (ss, pt);
622+
623+ try {
624+ boost::property_tree::read_json (ss, pt);
625+ } catch (const boost::property_tree::json_parser::json_parser_error&) {
626+ }
620627
621628 BOOST_FOREACH (boost::property_tree::ptree::value_type& v, pt.get_child (" objects" )) {
622629 assert (v.first .empty ()); // array elements have no names
You can’t perform that action at this time.
0 commit comments