MCPcopy
hub / github.com/ahmedkhaleel2004/gitdiagram / withFailure

Function withFailure

src/server/generate/session-audit.ts:127–145  ·  view source on GitHub ↗
(
  audit: GenerationSessionAudit,
  params: {
    failureStage: string;
    validationError?: string;
    compilerError?: string;
    renderError?: string;
  },
)

Source from the content-addressed store, hash-verified

125}
126
127export function withFailure(
128 audit: GenerationSessionAudit,
129 params: {
130 failureStage: string;
131 validationError?: string;
132 compilerError?: string;
133 renderError?: string;
134 },
135): GenerationSessionAudit {
136 return {
137 ...audit,
138 status: "failed",
139 failureStage: params.failureStage,
140 validationError: params.validationError,
141 compilerError: params.compilerError,
142 renderError: params.renderError,
143 updatedAt: nowIso(),
144 };
145}
146
147export function withSuccess(audit: GenerationSessionAudit): GenerationSessionAudit {
148 return {

Callers 1

runFunction · 0.90

Calls 1

nowIsoFunction · 0.85

Tested by

no test coverage detected