Add catch-all error reporting for errors that slip through run

This commit is contained in:
Henry Mercer
2026-01-22 13:14:53 +00:00
parent 14bd76753f
commit 229e0cd749
17 changed files with 447 additions and 101 deletions

View File

@@ -89829,6 +89829,27 @@ async function sendStatusReport(statusReport) {
);
}
}
async function sendUnexpectedErrorStatusReport(actionName, actionStartedAt, error3, logger) {
try {
const statusReport = await createStatusReportBase(
actionName,
"failure",
actionStartedAt,
void 0,
void 0,
logger,
void 0,
getErrorMessage(error3)
);
if (statusReport !== void 0) {
await sendStatusReport(statusReport);
}
} catch (e) {
logger.warning(
`Caught an exception while sending the error status report: ${e}.`
);
}
}
// src/setup-codeql-action.ts
async function sendCompletedStatusReport(startedAt, toolsDownloadStatusReport, toolsFeatureFlagsValid, toolsSource, toolsVersion, logger, error3) {
@@ -89861,8 +89882,7 @@ async function sendCompletedStatusReport(startedAt, toolsDownloadStatusReport, t
}
await sendStatusReport({ ...initStatusReport, ...initToolsDownloadFields });
}
async function run() {
const startedAt = /* @__PURE__ */ new Date();
async function run(startedAt) {
const logger = getActionsLogger();
let codeql;
let toolsDownloadStatusReport;
@@ -89949,10 +89969,18 @@ async function run() {
);
}
async function runWrapper() {
const startedAt = /* @__PURE__ */ new Date();
const logger = getActionsLogger();
try {
await run();
await run(startedAt);
} catch (error3) {
core12.setFailed(`setup-codeql action failed: ${getErrorMessage(error3)}`);
await sendUnexpectedErrorStatusReport(
"setup-codeql" /* SetupCodeQL */,
startedAt,
error3,
logger
);
}
await checkForTimeout();
}