mirror of
https://github.com/github/codeql-action.git
synced 2026-04-27 09:18:47 +00:00
Add catch-all error reporting for errors that slip through run
This commit is contained in:
Generated
+31
-3
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user