Skip to content

Commit

Permalink
socket: warn node_redis-style about missing error
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Feb 4, 2015
1 parent 816bfec commit 5ce06d3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,12 @@ Socket.prototype.ondisconnect = function(){
*/

Socket.prototype.onerror = function(err){
this.emit('error', err);
if (this.listeners('error').length) {
this.emit('error', err);
} else {
console.error('Missing error handler on `socket`.');
console.error(err.stack);
}
};

/**
Expand Down

0 comments on commit 5ce06d3

Please sign in to comment.