From cc8ea498a3ff9421765a99c347e03533cb0595d4 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 8 Dec 2019 16:28:48 +0100 Subject: Throw errors from CPLSummary constructor if the DCP::read reported any problems. --- src/lib/types.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/lib') 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 notes; + dcp.read (¬es); + 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(); -- cgit v1.2.3