summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-03-18 00:20:17 +0100
committerCarl Hetherington <cth@carlh.net>2021-03-18 23:30:48 +0100
commit4078aaae757db466d727c667dd9197b56d6b3f58 (patch)
tree47b733b51d838a7da708b9807478de1e166a5b4f /src
parentcf4e4272f72346c39964b128f78b2297f04dba55 (diff)
Improve errors when verifying a non-DCP directory.
Diffstat (limited to 'src')
-rw-r--r--src/dcp.cc2
-rw-r--r--src/exceptions.cc7
-rw-r--r--src/exceptions.h10
-rw-r--r--src/verify.cc8
4 files changed, 26 insertions, 1 deletions
diff --git a/src/dcp.cc b/src/dcp.cc
index df1d531b..20ff82f8 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -112,7 +112,7 @@ DCP::read (vector<dcp::VerificationNote>* notes, bool ignore_incorrect_picture_m
} else if (boost::filesystem::exists (_directory / "ASSETMAP.xml")) {
_asset_map = _directory / "ASSETMAP.xml";
} else {
- boost::throw_exception (ReadError(String::compose("Could not find ASSETMAP nor ASSETMAP.xml in '%1'", _directory.string())));
+ boost::throw_exception (MissingAssetmapError(_directory));
}
cxml::Document asset_map ("AssetMap");
diff --git a/src/exceptions.cc b/src/exceptions.cc
index 30d11a68..3d9b92ca 100644
--- a/src/exceptions.cc
+++ b/src/exceptions.cc
@@ -191,3 +191,10 @@ NoReelsError::NoReelsError ()
}
+
+MissingAssetmapError::MissingAssetmapError (boost::filesystem::path dir)
+ : ReadError (String::compose("Could not find ASSETMAP nor ASSETMAP.xml in '%1'", dir.string()))
+{
+
+}
+
diff --git a/src/exceptions.h b/src/exceptions.h
index 48961073..78d0943e 100644
--- a/src/exceptions.h
+++ b/src/exceptions.h
@@ -147,6 +147,16 @@ public:
};
+/** @class MissingAssetmapError
+ * @brief Thrown when no ASSETMAP was found when trying to read a DCP
+ */
+class MissingAssetmapError : public ReadError
+{
+public:
+ explicit MissingAssetmapError (boost::filesystem::path dir);
+};
+
+
/** @class XMLError
* @brief An XML error
*/
diff --git a/src/verify.cc b/src/verify.cc
index 8c367563..d8a4f37f 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -1122,8 +1122,12 @@ dcp::verify (
for (auto dcp: dcps) {
stage ("Checking DCP", dcp->directory());
+ bool carry_on = true;
try {
dcp->read (&notes);
+ } catch (MissingAssetmapError& e) {
+ notes.push_back ({VerificationNote::Type::ERROR, VerificationNote::Code::FAILED_READ, string(e.what())});
+ carry_on = false;
} catch (ReadError& e) {
notes.push_back ({VerificationNote::Type::ERROR, VerificationNote::Code::FAILED_READ, string(e.what())});
} catch (XMLError& e) {
@@ -1134,6 +1138,10 @@ dcp::verify (
notes.push_back ({VerificationNote::Type::ERROR, VerificationNote::Code::FAILED_READ, string(e.what())});
}
+ if (!carry_on) {
+ continue;
+ }
+
if (dcp->standard() != Standard::SMPTE) {
notes.push_back ({VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INVALID_STANDARD});
}