From fbdc606db9bb59f7c4f4ccab0c82e13552c87abf Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 28 Jan 2022 20:06:27 +0100 Subject: [PATCH] Improve error handling in CLI client slightly. --- src/tools/dcpomatic_cli.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tools/dcpomatic_cli.cc b/src/tools/dcpomatic_cli.cc index be4d3f513..1293eab0f 100644 --- a/src/tools/dcpomatic_cli.cc +++ b/src/tools/dcpomatic_cli.cc @@ -47,6 +47,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; @@ -403,7 +404,12 @@ main (int argc, char* argv[]) ); JobManager::instance()->add (job); } else { - film->make_dcp (behaviour); + try { + film->make_dcp (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); -- 2.30.2