Skip to content

Commit 9c643dc

Browse files
committed
Fix: Not raising an error for shortIndex.json not found
When the cache tries to update for the first time, the shortIndex.json file is not present. Therefore, it prints an error when it tries to delete it. But if the file is already not present, that means the job of unlinking is already complete. So not raising an error in that condition
1 parent 71e79d6 commit 9c643dc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ function clearPagesIndex() {
8080
clearRuntimeIndex();
8181
})
8282
.catch((err) => {
83-
console.error(err);
83+
// If the file is not present, then it is already unlinked and our job is done.
84+
// So raise an error only if it is some other scenario.
85+
if (err.code !== 'ENOENT') {
86+
console.error(err);
87+
}
8488
});
8589
}
8690

0 commit comments

Comments
 (0)