Files
rea/src/domain/providerCleanupError.ts
T
morluto 6eb55be4e8 fix(kuna): preserve live cleanup in caller failures
Reuse canonical typed failure attribution instead of copying cleanup markers. Preserve captured facts, typed primary outcomes and opaque cancellation reasons; bind caller projections to the exact producer cleanup owner.

Refs: #4693
2026-10-17 14:13:16 +08:00

29 lines
1.1 KiB
TypeScript

import type { JsonValue } from "./jsonValue.js";
import { ProviderAdapterError } from "./providerAdapterError.js";
import type { AnalysisErrorOptions } from "./analysisErrorBase.js";
/** Provider resources could not be proven closed after bounded cleanup. */
export class ProviderCleanupError extends ProviderAdapterError {
override cleanupIncomplete = true;
override readonly userMessage =
"Provider cleanup could not be fully confirmed. Review the reported local resources before opening another target.";
constructor(
providerId: string,
resources: readonly string[],
diagnostics: Readonly<Record<string, JsonValue>>,
/** Identify the operation owning these resources; binary callers retain their default. */
options?: Omit<AnalysisErrorOptions, "diagnostics"> & {
readonly operation?: string;
readonly remediationAction?: string;
},
) {
const { operation = "close_binary", ...errorOptions } = options ?? {};
super(providerId, operation, {
...errorOptions,
diagnostics,
});
this.setCleanupResources(resources);
}
}