From 55db77bb9120994d2ed0b6994d15307d959023da Mon Sep 17 00:00:00 2001 From: Tommaso Sciortino Date: Thu, 9 Apr 2026 22:25:23 +0000 Subject: [PATCH] fix(core): silently handle EPERM when listing dir structure (#25066) --- packages/core/src/utils/getFolderStructure.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/core/src/utils/getFolderStructure.ts b/packages/core/src/utils/getFolderStructure.ts index 5a2f99d729..5e7adc9d5b 100644 --- a/packages/core/src/utils/getFolderStructure.ts +++ b/packages/core/src/utils/getFolderStructure.ts @@ -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;