Throw errors from CPLSummary constructor if the DCP::read reported any problems.
authorCarl Hetherington <cth@carlh.net>
Sun, 8 Dec 2019 15:28:48 +0000 (16:28 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 8 Dec 2019 15:28:48 +0000 (16:28 +0100)
src/lib/types.cc

index 19e5da6ec78aa8c39c099f06d47f206cb3ab746d..9806c99712eb8d1a6c87e43cab4f39aeb530921f 100644 (file)
@@ -35,6 +35,7 @@
 using std::max;
 using std::min;
 using std::string;
+using std::list;
 using boost::shared_ptr;
 using dcp::raw_convert;
 
@@ -193,7 +194,11 @@ CPLSummary::CPLSummary (boost::filesystem::path p)
        : dcp_directory (p.leaf().string())
 {
        dcp::DCP dcp (p);
-       dcp.read ();
+       list<dcp::VerificationNote> notes;
+       dcp.read (&notes);
+       if (!notes.empty()) {
+               throw dcp::DCPReadError(dcp::note_to_string(notes.front()));
+       }
 
        cpl_id = dcp.cpls().front()->id();
        cpl_annotation_text = dcp.cpls().front()->annotation_text();