Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #571 from aheckmann/stringIsNotAnError

string is not an Error
  • Loading branch information...
commit 65c115c0dad6bd46d3e93941b1a37d44952a5d84 2 parents 6388f51 + 0a1fd22
@christkv authored
Showing with 7 additions and 5 deletions.
  1. +3 −3 lib/mongodb/connection/repl_set_servers.js
  2. +4 −2 lib/mongodb/db.js
View
6 lib/mongodb/connection/repl_set_servers.js
@@ -294,8 +294,8 @@ var cleanupTags = ReplSetServers._cleanupTags = function(server, byTags) {
var cleanInstances = [];
// We got instances for the particular tag set
var instances = byTags[serverTagKeys[i]][value];
- for(var j = 0; j < instances.length; j++) {
- var serverInstance = instances[j];
+ for(var j = 0, jlen = instances.length; j < jlen; j++) {
+ var serverInstance = instances[j];
// If we did not find an instance add it to the clean instances
if((serverInstance.host + ":" + serverInstance.port) !== (server.host + ":" + server.port)) {
cleanInstances.push(serverInstance);
@@ -971,4 +971,4 @@ ReplSetServers.prototype.close = function(callback) {
}
}
}
-}
+}
View
6 lib/mongodb/db.js
@@ -90,9 +90,11 @@ function Db(databaseName, serverConfig, options) {
this.bson_serializer = bsonLib;
} catch (err) {
// If we tried to instantiate the native driver
- throw "Native bson parser not compiled, please compile or avoid using native_parser=true";
+ var msg = "Native bson parser not compiled, please compile "
+ + "or avoid using native_parser=true";
+ throw Error(err);
}
-
+
// Internal state of the server
this._state = 'disconnected';
Please sign in to comment.
Something went wrong with that request. Please try again.