Files
rea/src/domain/webScriptExportError.ts
T
morluto bf7fad390c fix(cleanup): project resources from unresolved owners
Retain historical cleanup facts while deriving live resource attribution from exact error dependencies and labelled leases. Unlabelled owners preserve uncertainty.

Related: #4578
2026-10-17 04:21:21 +08:00

29 lines
999 B
TypeScript

import { ArtifactOperationError } from "./artifactOperationError.js";
import type { AnalysisErrorOptions } from "./analysisErrorBase.js";
/** Publication failure retaining its input/output target and cleanup state. */
export class WebScriptExportError extends ArtifactOperationError {
override readonly userMessage: string;
override cleanupIncomplete: boolean;
constructor(
reason: ArtifactOperationError["reason"],
target: string,
diagnostic: string,
options: AnalysisErrorOptions & {
readonly residualPaths?: readonly string[];
} = {},
) {
super("export_web_scripts", reason, undefined, undefined, options);
this.userMessage = `Script export failed for ${target}: ${diagnostic}`;
this.setCleanupResources([
...new Set([
...(options.cleanup?.resources ?? []),
...(options.residualPaths ?? []),
]),
]);
this.cleanupIncomplete =
options.cleanup !== undefined || (options.residualPaths?.length ?? 0) > 0;
}
}