*/
-/** @file src/job.cc
+/** @file src/job.cc
* @brief A parent class to represent long-running tasks which are run in their own thread.
*/
-#include <boost/thread.hpp>
-#include <boost/filesystem.hpp>
-#include <dcp/exceptions.h>
#include "job.h"
#include "util.h"
#include "cross.h"
#include "exceptions.h"
#include "film.h"
#include "log.h"
+#include "compose.hpp"
+#include <dcp/exceptions.h>
+#include <boost/thread.hpp>
+#include <boost/filesystem.hpp>
#include "i18n.h"
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
+ );
+ }
+
+ set_progress (1);
+ set_state (FINISHED_ERROR);
+
} catch (boost::thread_interrupted &) {
set_state (FINISHED_CANCELLED);
} else if (finished_ok ()) {
s << String::compose (_("OK (ran for %1)"), seconds_to_hms (_ran_for));
} else if (finished_in_error ()) {
- s << String::compose (_("Error (%1)"), error_summary ());
+ s << String::compose (_("Error: %1"), error_summary ());
} else if (finished_cancelled ()) {
s << _("Cancelled");
}