Improve error handling in CLI client slightly.
authorCarl Hetherington <cth@carlh.net>
Fri, 28 Jan 2022 19:06:27 +0000 (20:06 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 28 Jan 2022 19:06:27 +0000 (20:06 +0100)
src/tools/dcpomatic_cli.cc

index 9fe2743a6e4155eb5596bf56e69e351a2d1f68b3..0162dad8a892ab7c9d4955b092fa924001a4a7d9 100644 (file)
@@ -48,6 +48,7 @@ using std::cout;
 using std::dynamic_pointer_cast;
 using std::list;
 using std::pair;
+using std::runtime_error;
 using std::setw;
 using std::shared_ptr;
 using std::string;
@@ -404,7 +405,12 @@ main (int argc, char* argv[])
                        );
                JobManager::instance()->add (job);
        } else {
-               make_dcp (film, behaviour);
+               try {
+                       make_dcp (film, behaviour);
+               } catch (runtime_error& e) {
+                       std::cerr << "Could not make DCP: " << e.what() << "\n";
+                       exit(EXIT_FAILURE);
+               }
        }
 
        bool const error = show_jobs_on_console (progress);