fix: workaround misleading ENOENT error (#11160)

This commit is contained in:
Huáng Jùnliàng 2020-02-20 23:30:42 -05:00 committed by GitHub
parent 223cee7246
commit a583eab41f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,6 +43,9 @@ export function save() {
fs.writeFileSync(FILENAME, serialised);
} catch (e) {
switch (e.code) {
// workaround https://github.com/nodejs/node/issues/31481
// todo: remove the ENOENT error check when we drop node.js 13 support
case "ENOENT":
case "EACCES":
case "EPERM":
console.warn(