From 9c2bb26a2942862ff93c493a6caf4a7a51dd6859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Mon, 3 Apr 2017 22:34:54 -0700 Subject: [PATCH] fix(cache): pretend cache entry is missing on ENOENT --- cache.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cache.js b/cache.js index b976d98..24d7f7b 100644 --- a/cache.js +++ b/cache.js @@ -59,13 +59,14 @@ module.exports = class Cache { } return new this.Promise((resolve, reject) => { fs.stat(info.path, (err, stat) => { - if (err) { - return reject(err) + if (err && err !== 'ENOENT') { + return resolve(err) } else { return resolve(stat) } }) }).then(stat => { + if (!stat) { return } const cachePath = this._path let disturbed = false // avoid opening cache file handles until a user actually tries to