浏览代码

log error expect file doesn't exist

Abhinav 2 年之前
父节点
当前提交
11f2ce7110
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/services/fs.ts

+ 4 - 0
src/services/fs.ts

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