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
+31 -3
View File
@@ -92247,6 +92247,27 @@ async function createInitWithConfigStatusReport(config, initStatusReport, config
)
};
}
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/workflow.ts
var fs13 = __toESM(require("fs"));
@@ -92503,8 +92524,7 @@ async function sendCompletedStatusReport(startedAt, config, configFile, toolsDow
await sendStatusReport({ ...initStatusReport, ...initToolsDownloadFields });
}
}
async function run() {
const startedAt = /* @__PURE__ */ new Date();
async function run(startedAt) {
const logger = getActionsLogger();
let apiDetails;
let config;
@@ -92935,10 +92955,18 @@ async function recordZstdAvailability(config, zstdAvailability) {
);
}
async function runWrapper() {
const startedAt = /* @__PURE__ */ new Date();
const logger = getActionsLogger();
try {
await run();
await run(startedAt);
} catch (error3) {
core13.setFailed(`init action failed: ${getErrorMessage(error3)}`);
await sendUnexpectedErrorStatusReport(
"init" /* Init */,
startedAt,
error3,
logger
);
}
await checkForTimeout();
}