Skip to content

Commit

Permalink
[fix] Display warning / error messages to the user when contacting UN…
Browse files Browse the repository at this point in the history
…IX sockets. Fixes #88
  • Loading branch information
indexzero committed Jul 20, 2011
1 parent 72f200b commit f756e62
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/forever.js
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ function getAllProcesses (callback) {
var results = [],
sockPath = forever.config.get('sockPath'),
sockets = fs.readdirSync(sockPath);

if (sockets.length === 0) {
return callback();
}
Expand All @@ -742,8 +742,14 @@ function getAllProcesses (callback) {
catch (ex) { }
return next();
}
else if (err.code === 'EACCES') {
forever.log.warn('Error contacting: ' + fullPath.magenta);
}
else {
forever.log.error('Unknown error (' + err.code + ') when contacting: ' + fullPath.magenta);
}

next(err);
next();
});

socket.on('data', function (data) {
Expand Down

0 comments on commit f756e62

Please sign in to comment.