From: Carl Hetherington Date: Fri, 28 Jan 2022 19:06:27 +0000 (+0100) Subject: Improve error handling in CLI client slightly. X-Git-Tag: checked-for-v2.16.x~21 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=ce0852b6cc2ca1e8196c31fd9512bad2488b8a8c;p=dcpomatic.git Improve error handling in CLI client slightly. --- diff --git a/src/tools/dcpomatic_cli.cc b/src/tools/dcpomatic_cli.cc index 9fe2743a6..0162dad8a 100644 --- a/src/tools/dcpomatic_cli.cc +++ b/src/tools/dcpomatic_cli.cc @@ -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);