summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-07-26 19:09:36 +0100
committerCarl Hetherington <cth@carlh.net>2015-07-26 19:09:36 +0100
commit260e924ce6c84d08bfc62ba458e49b53716cff6e (patch)
tree35e1ce27d62025c6e342b47b2895aee2cd5a0c8f /src
parentb7144e7230c66fdeda96d3c993e32159cef771ae (diff)
Catch exceptions when loading KDMs.
Diffstat (limited to 'src')
-rw-r--r--src/wx/content_menu.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc
index 0adbc775a..2218c5c08 100644
--- a/src/wx/content_menu.cc
+++ b/src/wx/content_menu.cc
@@ -36,6 +36,7 @@
using std::cout;
using std::vector;
+using std::exception;
using boost::shared_ptr;
using boost::weak_ptr;
using boost::dynamic_pointer_cast;
@@ -312,7 +313,12 @@ ContentMenu::kdm ()
wxFileDialog* d = new wxFileDialog (_parent, _("Select KDM"));
if (d->ShowModal() == wxID_OK) {
- dcp->add_kdm (dcp::EncryptedKDM (dcp::file_to_string (wx_to_std (d->GetPath ()))));
+ try {
+ dcp->add_kdm (dcp::EncryptedKDM (dcp::file_to_string (wx_to_std (d->GetPath ()))));
+ } catch (exception& e) {
+ error_dialog (_parent, wxString::Format (_("Could not load KDM (%s)"), e.what ()));
+ }
+
shared_ptr<Film> film = _film.lock ();
DCPOMATIC_ASSERT (film);
film->examine_content (dcp);