Give better errors when incorrect KDMs are used (#1326).
[dcpomatic.git] / src / wx / content_menu.cc
index 2a91831341fc506bbd1ed739febb19db3c02c946..36187e00f307849308577fec31f512e7ee06171a 100644 (file)
@@ -35,6 +35,7 @@
 #include "lib/dcp_examiner.h"
 #include "lib/ffmpeg_content.h"
 #include "lib/audio_content.h"
+#include "lib/config.h"
 #include <dcp/cpl.h>
 #include <dcp/exceptions.h>
 #include <wx/wx.h>
@@ -145,6 +146,8 @@ ContentMenu::popup (weak_ptr<Film> film, ContentList c, TimelineContentViewList
                                /* The DCP is probably missing */
                        } catch (dcp::KDMDecryptionError) {
                                /* We have an incorrect KDM */
+                       } catch (KDMError) {
+                               /* We have an incorrect KDM */
                        }
                } else {
                        _kdm->Enable (false);
@@ -377,7 +380,7 @@ ContentMenu::kdm ()
                try {
                        dcp->add_kdm (dcp::EncryptedKDM (dcp::file_to_string (wx_to_std (d->GetPath ()), MAX_KDM_SIZE)));
                } catch (exception& e) {
-                       error_dialog (_parent, wxString::Format (_("Could not load KDM.")), std_to_wx(e.what()));
+                       error_dialog (_parent, _("Could not load KDM"), std_to_wx(e.what()));
                        d->Destroy ();
                        return;
                }