From eb58dc7c9ec9877c645585b7fb163d2bcc251b5d Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 20 Sep 2018 13:02:04 +0300 Subject: Fix bpkg to issue meaningful diagnostics if can't execute openssl --- bpkg/auth.cxx | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) (limited to 'bpkg/auth.cxx') diff --git a/bpkg/auth.cxx b/bpkg/auth.cxx index 5db1860..af49f37 100644 --- a/bpkg/auth.cxx +++ b/bpkg/auth.cxx @@ -173,16 +173,13 @@ namespace bpkg // Fall through. } - // For old versions of g++ (as of 4.9) ios_base::failure is not derived - // from system_error. - // - catch (const io_error& e) + catch (const process_error& e) { - calc_failed (&e); + error << "unable to execute " << co.openssl () << ": " << e; // Fall through. } - catch (const system_error& e) + catch (const io_error& e) { calc_failed (&e); @@ -449,16 +446,13 @@ namespace bpkg // Fall through. } - // For old versions of g++ (as of 4.9) ios_base::failure is not derived - // from system_error. - // - catch (const io_error& e) + catch (const process_error& e) { - parse_failed (&e); + error << "unable to execute " << co.openssl () << ": " << e; // Fall through. } - catch (const system_error& e) + catch (const io_error& e) { parse_failed (&e); @@ -855,16 +849,13 @@ namespace bpkg // Fall through. } - // For old versions of g++ (as of 4.9) ios_base::failure is not derived - // from system_error. - // - catch (const io_error& e) + catch (const process_error& e) { - auth_failed (&e); + error << "unable to execute " << co.openssl () << ": " << e; // Fall through. } - catch (const system_error& e) + catch (const io_error& e) { auth_failed (&e); @@ -932,16 +923,13 @@ namespace bpkg // Fall through. } - // For old versions of g++ (as of 4.9) ios_base::failure is not derived - // from system_error. - // - catch (const io_error& e) + catch (const process_error& e) { - sign_failed (&e); + error << "unable to execute " << co.openssl () << ": " << e; // Fall through. } - catch (const system_error& e) + catch (const io_error& e) { sign_failed (&e); -- cgit v1.1