Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

string is not an Error #571

Merged
merged 1 commit into from

2 participants

@aheckmann

Fix a string is not an error issue. Merge this before the replset PR

@aheckmann aheckmann string is not an Error
Conflicts:

	lib/mongodb/connection/repl_set_servers.js
0a1fd22
@christkv christkv merged commit 65c115c into mongodb:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 30, 2012
  1. @aheckmann

    string is not an Error

    aheckmann authored
    Conflicts:
    
    	lib/mongodb/connection/repl_set_servers.js
This page is out of date. Refresh to see the latest.
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';
Something went wrong with that request. Please try again.