Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Minor fixes to debug logging when a file or directory is removed; fix…
Browse files Browse the repository at this point in the history
… a spot where an error was logged to DBG instead of ERR
  • Loading branch information
stephen-palmer committed Oct 11, 2017
1 parent 1e6d45a commit 57598f9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/cache_fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,16 @@ class CacheFS {
if (fix) {
try {
var stat = fs.statSync(path);
if (stat.isDirectory())
if (stat.isDirectory()) {
fs.rmdirSync(path);
else
helpers.log(consts.LOG_DBG, msg + " Directory deleted.");
} else {
fs.unlinkSync(path);
helpers.log(consts.LOG_DBG, msg + " File deleted.");
helpers.log(consts.LOG_DBG, msg + " File deleted.");
}
}
catch (err) {
helpers.log(consts.LOG_DBG, err);
helpers.log(consts.LOG_ERR, err);
}
}
else {
Expand Down

0 comments on commit 57598f9

Please sign in to comment.