From 6c736757edebb8ee4c84284403b95dcf5cb59ece Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 11 Oct 2013 10:36:42 +0100 Subject: Improve error reporting from openssl calls. --- src/signer_chain.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/signer_chain.cc b/src/signer_chain.cc index 78a8f284..f538ce4f 100644 --- a/src/signer_chain.cc +++ b/src/signer_chain.cc @@ -35,16 +35,17 @@ using std::ifstream; using std::stringstream; using std::cout; -static void command (string c) +static void command (string cmd) { - int const r = system (c.c_str ()); + int const r = system (cmd.c_str ()); #ifdef LIBDCP_WINDOWS - if (r) { + int const code = r; #else - if (WEXITSTATUS (r)) { -#endif + int const code = WEXITSTATUS (r); +#endif + if (code) { stringstream s; - s << "error in " << c << "\n"; + s << "error " << code << " in " << cmd << " within " << boost::filesystem::current_path(); throw libdcp::MiscError (s.str()); } } -- cgit v1.2.3