From 9b1f5801eb0ae3524303b63b9b0d4cfee85867a9 Mon Sep 17 00:00:00 2001 From: Francois Kritzinger Date: Tue, 20 Feb 2024 10:43:10 +0200 Subject: JWT: OpenSSL error handling --- mod/mod-ci-github.cxx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'mod/mod-ci-github.cxx') diff --git a/mod/mod-ci-github.cxx b/mod/mod-ci-github.cxx index 53ec9a7..7a641a0 100644 --- a/mod/mod-ci-github.cxx +++ b/mod/mod-ci-github.cxx @@ -73,6 +73,7 @@ // the webhook request to restrict access, otherwise we get access to all // repos covered by the installation if installed on an organisation for // example. +// using namespace std; using namespace butl; @@ -245,20 +246,11 @@ handle (request& rq, response& rs) chrono::minutes (options_->ci_github_jwt_validity_period ()), chrono::seconds (60))); - if (jwt.empty ()) - fail << "unable to generate JWT: " << options_->openssl () - << " failed"; - cout << "JWT: " << jwt << endl; } catch (const system_error& e) { - fail << "unable to generate JWT: unable to execute " - << options_->openssl () << ": " << e.what (); - } - catch (const std::exception& e) - { - fail << "unable to generate JWT: " << e; + fail << "unable to generate JWT: [" << e.code () << "] " << e.what (); } return true; -- cgit v1.1