From edebb7861e8219e81797292963b8dfe2e441587e Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Fri, 23 Jan 2026 10:39:51 +0000 Subject: [PATCH] Differentiate unhandled errors in telemetry --- lib/analyze-action.js | 4 ++-- lib/autobuild-action.js | 4 ++-- lib/init-action-post.js | 4 ++-- lib/init-action.js | 4 ++-- lib/resolve-environment-action.js | 4 ++-- lib/setup-codeql-action.js | 4 ++-- lib/start-proxy-action.js | 4 ++-- lib/upload-sarif-action.js | 4 ++-- src/status-report.ts | 6 ++++-- 9 files changed, 20 insertions(+), 18 deletions(-) diff --git a/lib/analyze-action.js b/lib/analyze-action.js index e45e67a6a..9bfae0b60 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -94421,8 +94421,8 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error void 0, void 0, logger, - void 0, - getErrorMessage(error3) + `Unhandled error: ${getErrorMessage(error3)}`, + error3 instanceof Error ? error3.stack : void 0 ); if (statusReport !== void 0) { await sendStatusReport(statusReport); diff --git a/lib/autobuild-action.js b/lib/autobuild-action.js index 57885eac3..a04c64286 100644 --- a/lib/autobuild-action.js +++ b/lib/autobuild-action.js @@ -88893,8 +88893,8 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error void 0, void 0, logger, - void 0, - getErrorMessage(error3) + `Unhandled error: ${getErrorMessage(error3)}`, + error3 instanceof Error ? error3.stack : void 0 ); if (statusReport !== void 0) { await sendStatusReport(statusReport); diff --git a/lib/init-action-post.js b/lib/init-action-post.js index 5034549b0..dd4513a9b 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -130784,8 +130784,8 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error void 0, void 0, logger, - void 0, - getErrorMessage(error3) + `Unhandled error: ${getErrorMessage(error3)}`, + error3 instanceof Error ? error3.stack : void 0 ); if (statusReport !== void 0) { await sendStatusReport(statusReport); diff --git a/lib/init-action.js b/lib/init-action.js index 67df79fef..12c7c73cf 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -92258,8 +92258,8 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error void 0, void 0, logger, - void 0, - getErrorMessage(error3) + `Unhandled error: ${getErrorMessage(error3)}`, + error3 instanceof Error ? error3.stack : void 0 ); if (statusReport !== void 0) { await sendStatusReport(statusReport); diff --git a/lib/resolve-environment-action.js b/lib/resolve-environment-action.js index 032e47b97..dc3903dc7 100644 --- a/lib/resolve-environment-action.js +++ b/lib/resolve-environment-action.js @@ -88513,8 +88513,8 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error void 0, void 0, logger, - void 0, - getErrorMessage(error3) + `Unhandled error: ${getErrorMessage(error3)}`, + error3 instanceof Error ? error3.stack : void 0 ); if (statusReport !== void 0) { await sendStatusReport(statusReport); diff --git a/lib/setup-codeql-action.js b/lib/setup-codeql-action.js index 100459b82..a31eac0fe 100644 --- a/lib/setup-codeql-action.js +++ b/lib/setup-codeql-action.js @@ -89840,8 +89840,8 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error void 0, void 0, logger, - void 0, - getErrorMessage(error3) + `Unhandled error: ${getErrorMessage(error3)}`, + error3 instanceof Error ? error3.stack : void 0 ); if (statusReport !== void 0) { await sendStatusReport(statusReport); diff --git a/lib/start-proxy-action.js b/lib/start-proxy-action.js index aba9e48bb..eb5f9a8f6 100644 --- a/lib/start-proxy-action.js +++ b/lib/start-proxy-action.js @@ -104677,8 +104677,8 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error void 0, void 0, logger, - void 0, - getErrorMessage(error3) + `Unhandled error: ${getErrorMessage(error3)}`, + error3 instanceof Error ? error3.stack : void 0 ); if (statusReport !== void 0) { await sendStatusReport(statusReport); diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index 61826c285..7857564f5 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -91070,8 +91070,8 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error void 0, void 0, logger, - void 0, - getErrorMessage(error3) + `Unhandled error: ${getErrorMessage(error3)}`, + error3 instanceof Error ? error3.stack : void 0 ); if (statusReport !== void 0) { await sendStatusReport(statusReport); diff --git a/src/status-report.ts b/src/status-report.ts index 8b9b3a3a9..30b50e83d 100644 --- a/src/status-report.ts +++ b/src/status-report.ts @@ -616,6 +616,8 @@ export async function sendUnhandledErrorStatusReport( logger: Logger, ): Promise { try { + // In the future, we may want to add a specific field for unhandled errors so we can + // create a dedicated monitor for them. const statusReport = await createStatusReportBase( actionName, "failure", @@ -623,8 +625,8 @@ export async function sendUnhandledErrorStatusReport( undefined, undefined, logger, - undefined, - getErrorMessage(error), + `Unhandled error: ${getErrorMessage(error)}`, + error instanceof Error ? error.stack : undefined, ); if (statusReport !== undefined) { await sendStatusReport(statusReport);