From a4afc8e3dd6ce7c5f02d0eb69f03bf9f043afed0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 27 Apr 2014 20:50:13 +0100 Subject: Open an error dialogue on uncaught exceptions in the main loop. Check that the ImageContent constructor found some valid files when scanning a folder. --- src/lib/image_content.cc | 6 +++++- src/lib/job.cc | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/lib') diff --git a/src/lib/image_content.cc b/src/lib/image_content.cc index 13f7c52e3..3b87fcf00 100644 --- a/src/lib/image_content.cc +++ b/src/lib/image_content.cc @@ -44,7 +44,11 @@ ImageContent::ImageContent (shared_ptr f, boost::filesystem::path p) _paths.push_back (i->path ()); } } - + + if (_paths.empty()) { + throw FileError (_("No valid image files were found in the folder."), p); + } + sort (_paths.begin(), _paths.end()); } } diff --git a/src/lib/job.cc b/src/lib/job.cc index 52499b433..96aedac65 100644 --- a/src/lib/job.cc +++ b/src/lib/job.cc @@ -108,7 +108,7 @@ Job::run_wrapper () set_error ( e.what (), - _("It is not known what caused this error. The best idea is to report the problem to the DCP-o-matic mailing list (carl@dcpomatic.com)") + _("It is not known what caused this error. Please report the problem to the DCP-o-matic author (carl@dcpomatic.com).") ); set_progress (1); @@ -118,7 +118,7 @@ Job::run_wrapper () set_error ( _("Unknown error"), - _("It is not known what caused this error. The best idea is to report the problem to the DCP-o-matic mailing list (carl@dcpomatic.com)") + _("It is not known what caused this error. Please report the problem to the DCP-o-matic author (carl@dcpomatic.com).") ); set_progress (1); -- cgit v1.2.3