fix(core): silently handle EPERM when listing dir structure (#25066)

This commit is contained in:
Tommaso Sciortino
2026-04-09 22:25:23 +00:00
committed by GitHub
parent de628b04fc
commit 55db77bb91

View File

@@ -113,7 +113,9 @@ async function readFullStructure(
} catch (error: unknown) {
if (
isNodeError(error) &&
(error.code === 'EACCES' || error.code === 'ENOENT')
(error.code === 'EACCES' ||
error.code === 'ENOENT' ||
error.code === 'EPERM')
) {
debugLogger.warn(
`Warning: Could not read directory ${currentPath}: ${error.message}`,
@@ -121,7 +123,7 @@ async function readFullStructure(
if (currentPath === rootPath && error.code === 'ENOENT') {
return null; // Root directory itself not found
}
// For other EACCES/ENOENT on subdirectories, just skip them.
// For other EACCES/ENOENT/EPERM on subdirectories, just skip them.
continue;
}
throw error;