mirror of
https://github.com/morluto/rea.git
synced 2026-11-11 01:13:39 +00:00
fix(domain): preserve structured cleanup failure reasons
This commit is contained in:
1 parent
4d22c83b07
commit
396dcb2b0f
2 files changed
+9
-2
No files matched your search
@@ -165,13 +165,20 @@ it.each([
|
||||
"fixture",
|
||||
["owned-input"],
|
||||
{ reason: "close denied" },
|
||||
{ operation: "inspect" },
|
||||
{
|
||||
operation: "inspect",
|
||||
cleanup: { reason: "close denied", resources: ["owned-input"] },
|
||||
},
|
||||
);
|
||||
const composed = analysisErrorWithCleanupFailure(
|
||||
primary,
|
||||
cleanup,
|
||||
"inspect",
|
||||
).bindCleanupDependencies([primary, cleanup]);
|
||||
expect(composed.cleanup?.reason).toBe("close denied");
|
||||
expect(composed.cleanup?.reason).not.toBe(
|
||||
projectAnalysisError(cleanup).message,
|
||||
);
|
||||
const pending = projectAnalysisError(composed);
|
||||
expect(pending.code).toBe("cleanup_incomplete");
|
||||
expect(pending.category).toBe(original.category);
|
||||
|
||||
@@ -31,7 +31,7 @@ export const analysisErrorWithCleanupFailure = (
|
||||
? {}
|
||||
: { partialObservation: primary.partialObservation }),
|
||||
cleanup: {
|
||||
reason: projected.message,
|
||||
reason: cleanup.cleanup?.reason ?? projected.message,
|
||||
resources: [
|
||||
...new Set([
|
||||
...(primary.cleanupIncomplete ? primary.cleanupResources : []),
|
||||
|
||||
Reference in new issue
Block a user