log error expect file doesn't exist

This commit is contained in:
Abhinav 2023-02-07 15:23:58 +05:30
parent b3ccfe9d34
commit 11f2ce7110

View file

@ -188,6 +188,10 @@ export async function isFolder(dirPath: string) {
const stats = await fs.stat(dirPath); const stats = await fs.stat(dirPath);
return stats.isDirectory(); return stats.isDirectory();
} catch (e) { } catch (e) {
// ENOENT means the file does not exist
if (e?.code !== 'ENOENT') {
logError(e, 'isFolder failed ');
}
return false; return false;
} }
} }