Skip to content

Commit

Permalink
Merge pull request #11 from authbox-lib/master
Browse files Browse the repository at this point in the history
Don't raise an exception if saving failed
  • Loading branch information
bahmutov authored Aug 23, 2016
2 parents a06004f + aca8841 commit 22691a6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ function printCache() {
}

process.once('exit', function () {
fs.writeFileSync(SAVE_FILENAME,
JSON.stringify(nameCache, null, 2), 'utf-8');
try {
fs.writeFileSync(SAVE_FILENAME,
JSON.stringify(nameCache, null, 2), 'utf-8');
} catch (err) {
console.error('cache-require-paths: Failed saving cache: ' + err.toString());
}
});

0 comments on commit 22691a6

Please sign in to comment.