| 125 | } |
| 126 | |
| 127 | export 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 | |
| 147 | export function withSuccess(audit: GenerationSessionAudit): GenerationSessionAudit { |
| 148 | return { |