MCPcopy
hub / github.com/chartbrew/chartbrew / failRun

Function failRun

server/modules/updateAudit.js:548–576  ·  view source on GitHub ↗
(traceContext, error, options = {})

Source from the content-addressed store, hash-verified

546}
547
548async function failRun(traceContext, error, options = {}) {
549 if (!traceContext) {
550 return null;
551 }
552
553 const normalizedError = normalizeError(error, options.stage || "unknown");
554 const finishedAt = options.finishedAt || new Date();
555 const summary = sanitizePayload(options.summary || null);
556 const payload = sanitizePayload({
557 ...options.payload,
558 ...normalizedError,
559 });
560
561 const runFailedEvent = await startEvent(traceContext, "run_failed", payload);
562 await finishEvent(traceContext, runFailedEvent, "failed", payload);
563
564 await updateRunContext(traceContext, {
565 status: options.status || "failed",
566 finishedAt,
567 durationMs: getDurationMs(traceContext.startedAt || finishedAt, finishedAt),
568 errorStage: normalizedError.errorStage,
569 errorClass: normalizedError.errorClass,
570 errorCode: normalizedError.errorCode,
571 errorMessage: normalizedError.errorMessage,
572 summary,
573 });
574
575 return traceContext;
576}
577
578async function recordInstantEvent(traceContext, stage, payload = {}, status = "success") {
579 const event = await startEvent(traceContext, stage, payload);

Callers 8

runRequestMethod · 0.85
updateChartDataMethod · 0.85
failConnectorAuditFunction · 0.85
addDashboardToQueueFunction · 0.85
addChartsToQueueFunction · 0.85
updateChart.jsFile · 0.85
updateChartFunction · 0.85
updateDashboard.jsFile · 0.85

Calls 6

normalizeErrorFunction · 0.85
sanitizePayloadFunction · 0.85
startEventFunction · 0.85
finishEventFunction · 0.85
updateRunContextFunction · 0.85
getDurationMsFunction · 0.85

Tested by

no test coverage detected