From 51d86b751db4333e124eac06d36fc22e7f540f50 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 28 Feb 2016 18:16:45 +0000 Subject: [PATCH] Catch exceptions from content_factory(). --- src/wx/content_panel.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index cefb5b0d9..efc445bc9 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -46,6 +46,7 @@ using std::list; using std::string; using std::cout; using std::vector; +using std::exception; using boost::shared_ptr; using boost::weak_ptr; using boost::dynamic_pointer_cast; @@ -311,7 +312,15 @@ ContentPanel::add_folder_clicked () return; } - shared_ptr content = content_factory (_film, path); + shared_ptr content; + + try { + content = content_factory (_film, path); + } catch (exception& e) { + error_dialog (_parent, e.what()); + return; + } + if (!content) { error_dialog (_parent, _("No content found in this folder.")); return; -- 2.30.2