if (!have_metadata) {
throw DCPError ("No ASSETMAP or ASSETMAP.xml file found: is this a DCP?");
} else {
- throw DCPError (
- "This looks like a DCP-o-matic project folder, which cannot be added to a different project. "
- "Choose the DCP directory inside the DCP-o-matic project folder if that's what you want to import."
- );
+ throw ProjectFolderError ();
}
}
{}
};
+
+/** @class ProjectFolderError
+ * @brief An attempt has been made to read a DCP from a directory, but it looks
+ * like the directory actually contains a DCP-o-matic project.
+ */
+class ProjectFolderError : public DCPError
+{
+public:
+ /* Code which catches this exception will provide their own message */
+ ProjectFolderError ()
+ : DCPError ("dummy")
+ {}
+};
+
+
class InvalidSignerError : public std::runtime_error
{
public:
reset_film ();
try {
_stress.set_suspended (true);
+ // here
auto dcp = make_shared<DCPContent>(dir);
auto job = make_shared<ExamineContentJob>(_film, dcp);
_examine_job_connection = job->Finished.connect(bind(&DOMFrame::add_dcp_to_film, this, weak_ptr<Job>(job), weak_ptr<Content>(dcp)));
return;
}
Config::instance()->add_to_player_history (dir);
+ } catch (ProjectFolderError &) {
+ error_dialog (
+ this,
+ wxString::Format(_("Could not load a DCP from %s"), std_to_wx(dir.string())),
+ _(
+ "This looks like a DCP-o-matic project folder, which cannot be loaded into the player. "
+ "Choose the DCP directory inside the DCP-o-matic project folder if that's what you want to play."
+ )
+ );
} catch (dcp::ReadError& e) {
error_dialog (this, wxString::Format(_("Could not load a DCP from %s"), std_to_wx(dir.string())), std_to_wx(e.what()));
} catch (DCPError& e) {
try {
_film->examine_and_add_content (make_shared<DCPContent>(path));
+ } catch (ProjectFolderError &) {
+ error_dialog (
+ _parent,
+ _(
+ "This looks like a DCP-o-matic project folder, which cannot be added to a different project. "
+ "Choose the DCP directory inside the DCP-o-matic project folder if that's what you want to import."
+ )
+ );
} catch (exception& e) {
error_dialog (_parent, e.what());
}