using std::cout;
using std::vector;
+using std::exception;
using boost::shared_ptr;
using boost::weak_ptr;
using boost::dynamic_pointer_cast;
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);