mirror of
https://github.com/morluto/rea.git
synced 2026-11-13 18:22:42 +00:00
fix: preserve capture configuration failures
This commit is contained in:
1 parent
86fb3e757d
commit
44bbd13b55
2 files changed
+33
No files matched your search
@@ -17,6 +17,7 @@ import {
|
||||
AnalysisOutputError,
|
||||
} from "../domain/analysisErrorCore.js";
|
||||
import { AnalysisError } from "../domain/analysisErrorBase.js";
|
||||
import { ConfigurationError } from "../domain/configurationErrors.js";
|
||||
import { createEvidence, type Evidence } from "../domain/evidence.js";
|
||||
import { analysisErrorWithCleanupFailure } from "../domain/analysisErrorCleanup.js";
|
||||
import { analysisInputErrorFromIssues } from "../domain/inputIssueProjection.js";
|
||||
@@ -323,6 +324,16 @@ const captureReadFailure = (
|
||||
"Capture read and file-handle close both failed",
|
||||
{ cause },
|
||||
);
|
||||
if (cause instanceof ConfigurationError) {
|
||||
if (closeFailure === undefined) return cause;
|
||||
return new ConfigurationError(cause.message, {
|
||||
cause: causeWithClose,
|
||||
settings: cause.settings,
|
||||
...(cause.remediationAction === undefined
|
||||
? {}
|
||||
: { remediationAction: cause.remediationAction }),
|
||||
});
|
||||
}
|
||||
const code =
|
||||
cause instanceof Error && "code" in cause ? String(cause.code) : "";
|
||||
if (code === "EACCES" || code === "EPERM")
|
||||
|
||||
Reference in new issue
Block a user