summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-12-08 16:28:48 +0100
committerCarl Hetherington <cth@carlh.net>2019-12-08 16:28:48 +0100
commitcc8ea498a3ff9421765a99c347e03533cb0595d4 (patch)
tree2ecc3a6aa1ebc3efb6f3060f64c4987bc2b20bfa /src
parentfea83d9ef5d02149f857a11de79ed266773fd5a1 (diff)
Throw errors from CPLSummary constructor if the DCP::read reported any problems.
Diffstat (limited to 'src')
-rw-r--r--src/lib/types.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/types.cc b/src/lib/types.cc
index 19e5da6ec..9806c9971 100644
--- a/src/lib/types.cc
+++ b/src/lib/types.cc
@@ -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();