Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #64 from mdonnellyli/master

Propagates the error message from Mongo to the Error object
  • Loading branch information...
commit 5951275f20f3c2bae720277295f58f8c6449fff8 2 parents 0d5df55 + 90cdfa8
@kcbanner authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/connect-mongo.js
View
6 lib/connect-mongo.js
@@ -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) {
Please sign in to comment.
Something went wrong with that request. Please try again.