mirror of
https://github.com/morluto/rea.git
synced 2026-11-19 21:23:45 +00:00
refactor(resources): move the selected-file target error projection into src/resources (#11489)
This commit is contained in:
1 parent
9699ce9057
commit
d3350d81fd
5 files changed
+5
-7
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import { BinaryTargetError } from "../domain/configurationErrors.js";
|
||||
import { RejectedRegularFileSymlink } from "../filesystem/RegularFile.js";
|
||||
import { regularFileSymlinkRecovery } from "./StableArtifactFailure.js";
|
||||
|
||||
/** Project a selected-file admission failure without reinterpreting its path. */
|
||||
export const selectedFileTargetError = (
|
||||
path: string,
|
||||
primary: Error,
|
||||
cause: unknown,
|
||||
): BinaryTargetError =>
|
||||
new BinaryTargetError(path, primary.message, {
|
||||
cause,
|
||||
...(primary instanceof RejectedRegularFileSymlink &&
|
||||
primary.resolvedPath !== undefined
|
||||
? { remediationAction: regularFileSymlinkRecovery(primary.resolvedPath) }
|
||||
: {}),
|
||||
});
|
||||
Reference in new issue
Block a user