Skip to content

Commit

Permalink
feat: print logs for unhandled error event
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed May 8, 2016
1 parent be8d28e commit 097fdbc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,12 @@ Redis.prototype.silentEmit = function (eventName) {
if (this.listeners(eventName).length > 0) {
return this.emit.apply(this, arguments);
}
if (eventName === 'error') {
var error = arguments[1];
if (error instanceof Error) {
console.error('[ioredis] Unhandled error event:', error.stack);
}
}
return false;
};

Expand Down

0 comments on commit 097fdbc

Please sign in to comment.