mirror of
https://github.com/morluto/rea.git
synced 2026-11-10 00:36:35 +00:00
fix(input)!: classify unresolvable source paths (#7847)
This commit is contained in:
1 parent
e79ad6ca8e
commit
5bef2b48b6
12 files changed
+175
-7
No files matched your search
@@ -87,6 +87,7 @@ export const rootFilesystemFailure = (
|
||||
| {
|
||||
readonly code: "invalid-root" | "io";
|
||||
readonly message: string;
|
||||
readonly remediationAction?: string;
|
||||
}
|
||||
| undefined => {
|
||||
if (!(cause instanceof Error)) return undefined;
|
||||
@@ -94,8 +95,21 @@ export const rootFilesystemFailure = (
|
||||
if (typeof code !== "string" || !FILESYSTEM_ERROR_CODES.has(code))
|
||||
return undefined;
|
||||
return {
|
||||
code: code === "ENOENT" || code === "ENOTDIR" ? "invalid-root" : "io",
|
||||
code: ["ENOENT", "ENOTDIR", "ELOOP", "ENAMETOOLONG"].includes(code)
|
||||
? "invalid-root"
|
||||
: "io",
|
||||
message: `${operation}: ${cause.message}`,
|
||||
...(code === "ELOOP"
|
||||
? {
|
||||
remediationAction:
|
||||
"Repair the symbolic-link chain or select another reference source directory.",
|
||||
}
|
||||
: code === "ENAMETOOLONG"
|
||||
? {
|
||||
remediationAction:
|
||||
"Select a reference source path within the operating system's path-length limits.",
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user