Skip to content

Commit

Permalink
wrapped fs.unlinkSync in try-catch-block
Browse files Browse the repository at this point in the history
  • Loading branch information
fb55 committed Sep 16, 2012
1 parent 5b7f30b commit e52b063
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/monitor
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ function start(options) {
// When the monitor stops or exits, remove the pid and log files
//
function cleanUp(){
fs.unlinkSync(options.pidFile);
try {
fs.unlinkSync(options.pidFile);
}
catch(e){}
}
monitor.on('stop', cleanUp);
monitor.on('exit', cleanUp);
Expand Down

0 comments on commit e52b063

Please sign in to comment.