Try to catch libdcp::FileError more nicely.
authorCarl Hetherington <cth@carlh.net>
Wed, 18 Jul 2012 01:14:34 +0000 (02:14 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 18 Jul 2012 01:14:34 +0000 (02:14 +0100)
src/lib/job.cc

index 399b235d9bee7d0264d19da544c4a20f283966d8..0feb73d31b22b00f59d6c5cd6c3dea12c8d38a2e 100644 (file)
@@ -22,6 +22,8 @@
  */
 
 #include <boost/thread.hpp>
+#include <boost/filesystem.hpp>
+#include <libdcp/exceptions.h>
 #include "job.h"
 #include "util.h"
 
@@ -62,6 +64,14 @@ Job::run_wrapper ()
 
                run ();
 
+       } catch (libdcp::FileError& e) {
+               
+               set_progress (1);
+               set_state (FINISHED_ERROR);
+               stringstream s;
+               s << e.what() << "(" << filesystem::path (e.filename()).leaf() << ")";
+               set_error (s.str ());
+               
        } catch (std::exception& e) {
 
                set_progress (1);