From d8f6a06f0c1378b6489ab6c1c5c98337931ffdc2 Mon Sep 17 00:00:00 2001 From: Francois Kritzinger Date: Thu, 28 Nov 2024 14:34:33 +0200 Subject: build_building(): handle all exceptions --- mod/mod-ci-github.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mod') diff --git a/mod/mod-ci-github.cxx b/mod/mod-ci-github.cxx index 2c9034f..352ad5a 100644 --- a/mod/mod-ci-github.cxx +++ b/mod/mod-ci-github.cxx @@ -2099,6 +2099,7 @@ namespace brep build_building (const tenant_service& ts, const build& b, const diag_epilogue& log_writer) const noexcept + try { // NOTE: this function is noexcept and should not throw. @@ -2177,6 +2178,8 @@ namespace brep // if (iat != nullptr) { + // Let unlikely invalid_argument propagate. + // if (gq_update_check_run (error, *cr, iat->token, @@ -2242,6 +2245,16 @@ namespace brep return sd.json (); }; } + catch (const std::exception& e) + { + NOTIFICATION_DIAG (log_writer); + + string bid (gh_check_run_name (b)); // Full build id. + + error << "check run " << bid << ": unhandled exception: " << e.what(); + + return nullptr; + } function (const tenant_service&)> ci_github:: build_built (const tenant_service& ts, -- cgit v1.1