diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-02-28 18:16:45 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-02-28 18:16:45 +0000 |
| commit | 51d86b751db4333e124eac06d36fc22e7f540f50 (patch) | |
| tree | ebb92649b8b428fe8a676b135bf1be743fd3c214 /src | |
| parent | edaf69059c8be7d3ed32134343ea09f4393e6722 (diff) | |
Catch exceptions from content_factory().
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/content_panel.cc | 11 |
1 files changed, 10 insertions, 1 deletions
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 = content_factory (_film, path); + shared_ptr<Content> 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; |
