Permalink
Browse files

Added logging from mongo to the error messages

  • Loading branch information...
savantly committed Apr 17, 2013
1 parent 0d5df55 commit 90cdfa812ea735956823499996fc7873f87af8cc
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/connect-mongo.js
View
@@ -125,7 +125,7 @@ module.exports = function(connect) {
} else {
self.db.collection(self.db_collection_name, function(err, collection) {
if (err) {
- throw new Error('Error getting collection: ' + self.db_collection_name);
+ throw new Error('Error getting collection: ' + self.db_collection_name + ' <' + err + '>');
} else {
self.collection = collection;
@@ -134,7 +134,7 @@ module.exports = function(connect) {
// mongo to remove anything expired without any additional delay.
self.collection.ensureIndex({expires: 1}, {expireAfterSeconds: 0}, function(err, result) {
if (err) {
- throw new Error('Error setting TTL index on collection : ' + self.db_collection_name);
+ throw new Error('Error setting TTL index on collection : ' + self.db_collection_name + ' <' + err + '>');
}
callback && callback(self.collection);
@@ -150,7 +150,7 @@ module.exports = function(connect) {
else {
this.db.open(function(err, db) {
if (err) {
- throw new Error('Error connecting to database');
+ throw new Error('Error connecting to database <' + err + '>');
}
if (options.username && options.password) {

0 comments on commit 90cdfa8

Please sign in to comment.