mirror of
https://github.com/morluto/rea
synced 2026-10-26 06:16:17 -04:00
bf7fad390c
Retain historical cleanup facts while deriving live resource attribution from exact error dependencies and labelled leases. Unlabelled owners preserve uncertainty. Related: #4578
29 lines
999 B
TypeScript
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;
|
|
}
|
|
}
|