Permalink
Browse files

Catch errors from mongodb server.

  • Loading branch information...
1 parent 1313d64 commit 3614ebd38faef8d3f9549c8ef42854576bc17c6e @yosefd yosefd committed Apr 27, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/winston-mongodb.js
@@ -46,6 +46,10 @@ var MongoDB = exports.MongoDB = function (options) {
native_parser: false
});
+ self.server.on('error', function (err) {
+ // Close session. Next log will reopen.
+ self.close();
+ });
self.client.on('error', function (err) {
// Close session. Next log will reopen.
self.close();

0 comments on commit 3614ebd

Please sign in to comment.