fix(ui): add ENAMETOOLONG and ENOTDIR to exceptions for file parsing errors (#27069)

This commit is contained in:
Dev Randalpura
2026-05-14 17:23:42 -04:00
committed by GitHub
parent 0c0d88d90b
commit 7a5a8183bf
+8 -2
View File
@@ -440,7 +440,10 @@ function robustRealpath(p: string, visited = new Set<string>()): string {
e &&
typeof e === 'object' &&
'code' in e &&
(e.code === 'ENOENT' || e.code === 'EISDIR')
(e.code === 'ENOENT' ||
e.code === 'EISDIR' ||
e.code === 'ENAMETOOLONG' ||
e.code === 'ENOTDIR')
) {
try {
const stat = fs.lstatSync(p);
@@ -457,7 +460,10 @@ function robustRealpath(p: string, visited = new Set<string>()): string {
lstatError &&
typeof lstatError === 'object' &&
'code' in lstatError &&
(lstatError.code === 'ENOENT' || lstatError.code === 'EISDIR')
(lstatError.code === 'ENOENT' ||
lstatError.code === 'EISDIR' ||
lstatError.code === 'ENAMETOOLONG' ||
lstatError.code === 'ENOTDIR')
)
) {
throw lstatError;