mirror of
https://github.com/morluto/rea.git
synced 2026-11-13 18:22:42 +00:00
refactor: remove redundant seams and preserve cleanup ownership (#10375)
* refactor: remove redundant seams and preserve cleanup ownership * fix: validate PE resource extents before budget checks
This commit is contained in:
1 parent
4b26f38d6f
commit
cdc4541ef7
369 files changed
+3847
-3662
No files matched your search
@@ -1,10 +1,10 @@
|
||||
import { PYTHON_PYC_PROVIDER_IDENTITY } from "./PythonPycProviderIdentity.js";
|
||||
import {
|
||||
projectSelectedArtifactFileFailure,
|
||||
projectStableArtifactFailure,
|
||||
stableArtifactInputRecovery,
|
||||
projectArtifactCloseFailure,
|
||||
} from "../artifacts/StableArtifactFailure.js";
|
||||
import { isSelectedRegularFileError } from "../filesystem/RegularFile.js";
|
||||
import {
|
||||
artifactFileCancellationCause,
|
||||
artifactFilePrimaryFacts,
|
||||
@@ -20,7 +20,6 @@ import type { PythonPycPort } from "../application/python/PythonPycPort.js";
|
||||
import type { ExecutionOptions } from "../application/AnalysisProvider.js";
|
||||
import { AnalysisError } from "../domain/analysisErrorBase.js";
|
||||
import {
|
||||
AnalysisAccessDeniedError,
|
||||
AnalysisArtifactChangedError,
|
||||
AnalysisCancelledError,
|
||||
AnalysisInputError,
|
||||
@@ -142,20 +141,13 @@ const failureForPrimary = (
|
||||
],
|
||||
);
|
||||
}
|
||||
if (cause instanceof Error && "code" in cause) {
|
||||
if (cause.code === "EACCES" || cause.code === "EPERM")
|
||||
return new AnalysisAccessDeniedError(OPERATION, input.path, cause.code, {
|
||||
cause,
|
||||
});
|
||||
if (isSelectedRegularFileError(cause))
|
||||
return new AnalysisInputError(OPERATION, { cause }, [
|
||||
{
|
||||
path: ["path"],
|
||||
reason: "invalid_value",
|
||||
message: `Selected pyc could not be read (${String(cause.code)}): ${input.path}.`,
|
||||
},
|
||||
]);
|
||||
}
|
||||
const fileFailure = projectSelectedArtifactFileFailure(
|
||||
cause,
|
||||
OPERATION,
|
||||
input.path,
|
||||
"pyc",
|
||||
);
|
||||
if (fileFailure !== undefined) return fileFailure;
|
||||
return new ProviderAdapterError(PYTHON_PYC_PROVIDER_IDENTITY.id, OPERATION, {
|
||||
cause,
|
||||
diagnostics: {
|
||||
|
||||
Reference in new issue
Block a user