} 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");
}
+
+MissingAssetmapError::MissingAssetmapError (boost::filesystem::path dir)
+ : ReadError (String::compose("Could not find ASSETMAP nor ASSETMAP.xml in '%1'", dir.string()))
+{
+
+}
+
};
+/** @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
*/
for (auto dcp: dcps) {
stage ("Checking DCP", dcp->directory());
+ bool carry_on = true;
try {
dcp->read (¬es);
+ } 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) {
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});
}