summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-04-01 23:38:34 +0200
committerCarl Hetherington <cth@carlh.net>2025-12-15 17:13:38 +0100
commit43c3b0bcbbb24e5f57c9a14f4bc6b81f825711da (patch)
treeed95011e555a4f3a11c1e5c0f08cd40b51c58ed7 /src
parent38daa092cedd5f67a4b47613714beb5ce6d07265 (diff)
Use error for FAILED_READ.
Diffstat (limited to 'src')
-rw-r--r--src/verify.cc20
-rw-r--r--src/verify.h2
2 files changed, 12 insertions, 10 deletions
diff --git a/src/verify.cc b/src/verify.cc
index cc2c67ea..3dede014 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -1909,25 +1909,27 @@ dcp::verify (
context.dcp = dcp;
+ using VN = dcp::VerificationNote;
+
bool carry_on = true;
try {
dcp->read (&notes, true);
} catch (MissingAssetmapError& e) {
- context.error(VerificationNote::Code::FAILED_READ, string(e.what()));
+ context.add_note(VN(VN::Type::ERROR, VN::Code::FAILED_READ).set_error(e.what()));
carry_on = false;
} catch (ReadError& e) {
- context.error(VerificationNote::Code::FAILED_READ, string(e.what()));
+ context.add_note(VN(VN::Type::ERROR, VN::Code::FAILED_READ).set_error(e.what()));
} catch (XMLError& e) {
- context.error(VerificationNote::Code::FAILED_READ, string(e.what()));
+ context.add_note(VN(VN::Type::ERROR, VN::Code::FAILED_READ).set_error(e.what()));
} catch (MXFFileError& e) {
- context.error(VerificationNote::Code::FAILED_READ, string(e.what()));
+ context.add_note(VN(VN::Type::ERROR, VN::Code::FAILED_READ).set_error(e.what()));
} catch (BadURNUUIDError& e) {
- context.error(VerificationNote::Code::FAILED_READ, string(e.what()));
+ context.add_note(VN(VN::Type::ERROR, VN::Code::FAILED_READ).set_error(e.what()));
} catch (cxml::Error& e) {
- context.error(VerificationNote::Code::FAILED_READ, string(e.what()));
+ context.add_note(VN(VN::Type::ERROR, VN::Code::FAILED_READ).set_error(e.what()));
} catch (xmlpp::parse_error& e) {
carry_on = false;
- context.error(VerificationNote::Code::FAILED_READ, string(e.what()));
+ context.add_note(VN(VN::Type::ERROR, VN::Code::FAILED_READ).set_error(e.what()));
}
if (!carry_on) {
@@ -1950,7 +1952,7 @@ dcp::verify (
context.audio_channels.reset();
context.subtitle_language.reset();
} catch (ReadError& e) {
- notes.push_back({VerificationNote::Type::ERROR, VerificationNote::Code::FAILED_READ, string(e.what())});
+ notes.push_back(VN(VN::Type::ERROR, VN::Code::FAILED_READ).set_error(e.what()));
}
}
@@ -1993,7 +1995,7 @@ dcp::note_to_string(VerificationNote note, function<string (string)> process_str
switch (note.code()) {
case VerificationNote::Code::FAILED_READ:
- return process_string(*note.note());
+ return process_string(*note.error());
case VerificationNote::Code::MATCHING_CPL_HASHES:
return process_string("The hash of the CPL in the PKL matches the CPL file.");
case VerificationNote::Code::MISMATCHED_CPL_HASHES:
diff --git a/src/verify.h b/src/verify.h
index 45d1de58..b11e4a6f 100644
--- a/src/verify.h
+++ b/src/verify.h
@@ -100,7 +100,7 @@ public:
// _foo_ means foo should be written as a piece of code
enum class Code {
/** A general error when reading the DCP
- * note contains (probably technical) details
+ * error contains (probably technical) details
*/
FAILED_READ,
/** The hash of a CPL in the PKL agrees with the CPL file */