Skip to content

Commit

Permalink
Merge pull request mongodb#571 from aheckmann/stringIsNotAnError
Browse files Browse the repository at this point in the history
string is not an Error
  • Loading branch information
christkv committed Mar 30, 2012
2 parents 6388f51 + 0a1fd22 commit 65c115c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/mongodb/connection/repl_set_servers.js
Expand Up @@ -294,8 +294,8 @@ var cleanupTags = ReplSetServers._cleanupTags = function(server, byTags) {
var cleanInstances = []; var cleanInstances = [];
// We got instances for the particular tag set // We got instances for the particular tag set
var instances = byTags[serverTagKeys[i]][value]; var instances = byTags[serverTagKeys[i]][value];
for(var j = 0; j < instances.length; j++) { for(var j = 0, jlen = instances.length; j < jlen; j++) {
var serverInstance = instances[j]; var serverInstance = instances[j];
// If we did not find an instance add it to the clean instances // If we did not find an instance add it to the clean instances
if((serverInstance.host + ":" + serverInstance.port) !== (server.host + ":" + server.port)) { if((serverInstance.host + ":" + serverInstance.port) !== (server.host + ":" + server.port)) {
cleanInstances.push(serverInstance); cleanInstances.push(serverInstance);
Expand Down Expand Up @@ -971,4 +971,4 @@ ReplSetServers.prototype.close = function(callback) {
} }
} }
} }
} }
6 changes: 4 additions & 2 deletions lib/mongodb/db.js
Expand Up @@ -90,9 +90,11 @@ function Db(databaseName, serverConfig, options) {
this.bson_serializer = bsonLib; this.bson_serializer = bsonLib;
} catch (err) { } catch (err) {
// If we tried to instantiate the native driver // 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 // Internal state of the server
this._state = 'disconnected'; this._state = 'disconnected';


Expand Down

0 comments on commit 65c115c

Please sign in to comment.