summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-08-05 18:07:37 +0100
committerCarl Hetherington <cth@carlh.net>2015-08-05 18:07:37 +0100
commit7ff262bc7a3e5ac16feab2fe7a0afbbe14c33896 (patch)
tree4699dfc02a97ea8db5ca0dceab50e92e13594efc
parente8577fdd7726ecd6ef90bf20958323ea810404bd (diff)
Improve error reporting, in particular from dcpomatic_create.
-rw-r--r--src/lib/film.cc2
-rw-r--r--src/lib/job.cc30
2 files changed, 19 insertions, 13 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 3e02ca4e2..5e7bab0b7 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -926,7 +926,7 @@ Film::examine_content (shared_ptr<Content> c)
void
Film::examine_and_add_content (shared_ptr<Content> c)
{
- if (dynamic_pointer_cast<FFmpegContent> (c)) {
+ if (dynamic_pointer_cast<FFmpegContent> (c) && !_directory.empty ()) {
run_ffprobe (c->path(0), file ("ffprobe.log"), _log);
}
diff --git a/src/lib/job.cc b/src/lib/job.cc
index 8c46b4962..a266fbe07 100644
--- a/src/lib/job.cc
+++ b/src/lib/job.cc
@@ -84,8 +84,6 @@ Job::run_wrapper ()
}
set_error (e.what(), m);
- set_progress (1);
- set_state (FINISHED_ERROR);
} catch (OpenFileError& e) {
@@ -94,18 +92,29 @@ Job::run_wrapper ()
String::compose (_("DCP-o-matic could not open the file %1. Perhaps it does not exist or is in an unexpected format."), e.file().string())
);
- set_progress (1);
- set_state (FINISHED_ERROR);
+ } catch (boost::filesystem::filesystem_error& e) {
+
+ if (e.code() == boost::system::errc::no_such_file_or_directory) {
+ set_error (
+ String::compose (_("Could not open %1"), e.path1().string ()),
+ String::compose (_("DCP-o-matic could not open the file %1. Perhaps it does not exist or is in an unexpected format."), e.path1().string())
+ );
+ } else {
+ set_error (
+ e.what (),
+ string (_("It is not known what caused this error.")) + " " + REPORT_PROBLEM
+ );
+ }
} catch (boost::thread_interrupted &) {
set_state (FINISHED_CANCELLED);
+ /* This is the only one that is not FINISHED_ERROR; need to return */
+ return;
} catch (std::bad_alloc& e) {
set_error (_("Out of memory"), _("There was not enough memory to do this."));
- set_progress (1);
- set_state (FINISHED_ERROR);
} catch (std::exception& e) {
@@ -114,19 +123,16 @@ Job::run_wrapper ()
string (_("It is not known what caused this error.")) + " " + REPORT_PROBLEM
);
- set_progress (1);
- set_state (FINISHED_ERROR);
-
} catch (...) {
set_error (
_("Unknown error"),
string (_("It is not known what caused this error.")) + " " + REPORT_PROBLEM
);
-
- set_progress (1);
- set_state (FINISHED_ERROR);
}
+
+ set_progress (1);
+ set_state (FINISHED_ERROR);
}
/** @return true if this job is new (ie has not started running) */