From fba78720cab61bc9326b24527e56282372bf34d3 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Fri, 23 Jan 2026 12:22:31 +0000 Subject: [PATCH] Address review comments --- lib/analyze-action.js | 8 ++------ lib/autobuild-action.js | 8 ++------ lib/init-action-post.js | 8 ++------ lib/init-action.js | 8 ++------ lib/resolve-environment-action.js | 8 ++------ lib/setup-codeql-action.js | 8 ++------ lib/start-proxy-action.js | 8 ++------ lib/upload-sarif-action.js | 8 ++------ src/status-report.ts | 8 ++------ 9 files changed, 18 insertions(+), 54 deletions(-) diff --git a/lib/analyze-action.js b/lib/analyze-action.js index cb078b4ef..f2f71755f 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -94421,19 +94421,15 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error void 0, void 0, logger, - `Unhandled error: ${getErrorMessage(error3)}`, + `Unhandled CodeQL Action error: ${getErrorMessage(error3)}`, error3 instanceof Error ? error3.stack : void 0 ); if (statusReport !== void 0) { await sendStatusReport(statusReport); - } else if (isInTestMode()) { - throw new Error( - "Failed to create status report for unhandled error in test mode." - ); } } catch (e) { logger.warning( - `Failed to send the error status report: ${getErrorMessage(e)}.` + `Failed to send the unhandled error status report: ${getErrorMessage(e)}.` ); if (isInTestMode()) { throw e; diff --git a/lib/autobuild-action.js b/lib/autobuild-action.js index 842960f50..bf18e8f55 100644 --- a/lib/autobuild-action.js +++ b/lib/autobuild-action.js @@ -88893,19 +88893,15 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error void 0, void 0, logger, - `Unhandled error: ${getErrorMessage(error3)}`, + `Unhandled CodeQL Action error: ${getErrorMessage(error3)}`, error3 instanceof Error ? error3.stack : void 0 ); if (statusReport !== void 0) { await sendStatusReport(statusReport); - } else if (isInTestMode()) { - throw new Error( - "Failed to create status report for unhandled error in test mode." - ); } } catch (e) { logger.warning( - `Failed to send the error status report: ${getErrorMessage(e)}.` + `Failed to send the unhandled error status report: ${getErrorMessage(e)}.` ); if (isInTestMode()) { throw e; diff --git a/lib/init-action-post.js b/lib/init-action-post.js index 3d6a7deb3..3d35e9824 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -130784,19 +130784,15 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error void 0, void 0, logger, - `Unhandled error: ${getErrorMessage(error3)}`, + `Unhandled CodeQL Action error: ${getErrorMessage(error3)}`, error3 instanceof Error ? error3.stack : void 0 ); if (statusReport !== void 0) { await sendStatusReport(statusReport); - } else if (isInTestMode()) { - throw new Error( - "Failed to create status report for unhandled error in test mode." - ); } } catch (e) { logger.warning( - `Failed to send the error status report: ${getErrorMessage(e)}.` + `Failed to send the unhandled error status report: ${getErrorMessage(e)}.` ); if (isInTestMode()) { throw e; diff --git a/lib/init-action.js b/lib/init-action.js index e1e3adc6e..34a3a1086 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -92258,19 +92258,15 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error void 0, void 0, logger, - `Unhandled error: ${getErrorMessage(error3)}`, + `Unhandled CodeQL Action error: ${getErrorMessage(error3)}`, error3 instanceof Error ? error3.stack : void 0 ); if (statusReport !== void 0) { await sendStatusReport(statusReport); - } else if (isInTestMode()) { - throw new Error( - "Failed to create status report for unhandled error in test mode." - ); } } catch (e) { logger.warning( - `Failed to send the error status report: ${getErrorMessage(e)}.` + `Failed to send the unhandled error status report: ${getErrorMessage(e)}.` ); if (isInTestMode()) { throw e; diff --git a/lib/resolve-environment-action.js b/lib/resolve-environment-action.js index 67d710d89..239f35bcd 100644 --- a/lib/resolve-environment-action.js +++ b/lib/resolve-environment-action.js @@ -88513,19 +88513,15 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error void 0, void 0, logger, - `Unhandled error: ${getErrorMessage(error3)}`, + `Unhandled CodeQL Action error: ${getErrorMessage(error3)}`, error3 instanceof Error ? error3.stack : void 0 ); if (statusReport !== void 0) { await sendStatusReport(statusReport); - } else if (isInTestMode()) { - throw new Error( - "Failed to create status report for unhandled error in test mode." - ); } } catch (e) { logger.warning( - `Failed to send the error status report: ${getErrorMessage(e)}.` + `Failed to send the unhandled error status report: ${getErrorMessage(e)}.` ); if (isInTestMode()) { throw e; diff --git a/lib/setup-codeql-action.js b/lib/setup-codeql-action.js index 59605c1fb..6af67bc08 100644 --- a/lib/setup-codeql-action.js +++ b/lib/setup-codeql-action.js @@ -89840,19 +89840,15 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error void 0, void 0, logger, - `Unhandled error: ${getErrorMessage(error3)}`, + `Unhandled CodeQL Action error: ${getErrorMessage(error3)}`, error3 instanceof Error ? error3.stack : void 0 ); if (statusReport !== void 0) { await sendStatusReport(statusReport); - } else if (isInTestMode()) { - throw new Error( - "Failed to create status report for unhandled error in test mode." - ); } } catch (e) { logger.warning( - `Failed to send the error status report: ${getErrorMessage(e)}.` + `Failed to send the unhandled error status report: ${getErrorMessage(e)}.` ); if (isInTestMode()) { throw e; diff --git a/lib/start-proxy-action.js b/lib/start-proxy-action.js index 93978c289..16809bda3 100644 --- a/lib/start-proxy-action.js +++ b/lib/start-proxy-action.js @@ -104677,19 +104677,15 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error void 0, void 0, logger, - `Unhandled error: ${getErrorMessage(error3)}`, + `Unhandled CodeQL Action error: ${getErrorMessage(error3)}`, error3 instanceof Error ? error3.stack : void 0 ); if (statusReport !== void 0) { await sendStatusReport(statusReport); - } else if (isInTestMode()) { - throw new Error( - "Failed to create status report for unhandled error in test mode." - ); } } catch (e) { logger.warning( - `Failed to send the error status report: ${getErrorMessage(e)}.` + `Failed to send the unhandled error status report: ${getErrorMessage(e)}.` ); if (isInTestMode()) { throw e; diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index e5fc6230a..6bd0faade 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -91070,19 +91070,15 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error void 0, void 0, logger, - `Unhandled error: ${getErrorMessage(error3)}`, + `Unhandled CodeQL Action error: ${getErrorMessage(error3)}`, error3 instanceof Error ? error3.stack : void 0 ); if (statusReport !== void 0) { await sendStatusReport(statusReport); - } else if (isInTestMode()) { - throw new Error( - "Failed to create status report for unhandled error in test mode." - ); } } catch (e) { logger.warning( - `Failed to send the error status report: ${getErrorMessage(e)}.` + `Failed to send the unhandled error status report: ${getErrorMessage(e)}.` ); if (isInTestMode()) { throw e; diff --git a/src/status-report.ts b/src/status-report.ts index 532e692f0..4471b3ce9 100644 --- a/src/status-report.ts +++ b/src/status-report.ts @@ -625,19 +625,15 @@ export async function sendUnhandledErrorStatusReport( undefined, undefined, logger, - `Unhandled error: ${getErrorMessage(error)}`, + `Unhandled CodeQL Action error: ${getErrorMessage(error)}`, error instanceof Error ? error.stack : undefined, ); if (statusReport !== undefined) { await sendStatusReport(statusReport); - } else if (isInTestMode()) { - throw new Error( - "Failed to create status report for unhandled error in test mode.", - ); } } catch (e) { logger.warning( - `Failed to send the error status report: ${getErrorMessage(e)}.`, + `Failed to send the unhandled error status report: ${getErrorMessage(e)}.`, ); if (isInTestMode()) { throw e;