Skip to content
This repository has been archived by the owner on Jun 12, 2022. It is now read-only.

Commit

Permalink
fix(cache): fix handling of errors in cache reads
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Apr 5, 2017
1 parent cb87be6 commit 5729222
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,13 @@ module.exports = class Cache {
}
return new this.Promise((resolve, reject) => {
fs.stat(info.path, (err, stat) => {
if (err && err !== 'ENOENT') {
return resolve(err)
if (err) {
return reject(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
Expand Down

0 comments on commit 5729222

Please sign in to comment.