Fix build.
[dcpomatic.git] / src / lib / job.cc
index ccb75fa9332379ad27488da0e101ba786c150986..3472f27768b5d8082ff09bbfa01230fb2f664b6b 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -28,6 +28,7 @@
 #include "exceptions.h"
 #include "film.h"
 #include "log.h"
+#include "analytics.h"
 #include "compose.hpp"
 #include <dcp/exceptions.h>
 #include <sub/exceptions.h>
@@ -174,6 +175,18 @@ Job::run_wrapper ()
                set_progress (1);
                set_state (FINISHED_ERROR);
 
+       } catch (dcp::DCPReadError& e) {
+
+               set_error (e.what(), "");//message(), e.detail().get_value_or(""));
+               set_progress (1);
+               set_state (FINISHED_ERROR);
+
+       } catch (KDMError& e) {
+
+               set_error (e.summary(), e.detail());
+               set_progress (1);
+               set_state (FINISHED_ERROR);
+
        } catch (std::exception& e) {
 
                set_error (
@@ -274,11 +287,14 @@ Job::set_state (State s)
                        finished = true;
                        _sub_name.clear ();
                }
+
        }
 
        if (finished) {
                emit (boost::bind (boost::ref (Finished)));
        }
+
+       Analytics::instance()->job_state_changed (shared_from_this());
 }
 
 /** @return DCPTime (in seconds) that this sub-job has been running */