diff options
Diffstat (limited to 'src/mongo/client/dbclient_rs.cpp')
-rw-r--r-- | src/mongo/client/dbclient_rs.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/mongo/client/dbclient_rs.cpp b/src/mongo/client/dbclient_rs.cpp index 10547fc66c1..dec27398071 100644 --- a/src/mongo/client/dbclient_rs.cpp +++ b/src/mongo/client/dbclient_rs.cpp @@ -449,12 +449,9 @@ void DBClientReplicaSet::_auth(const BSONObj& params) { throw; } - const Status status = ex.toStatus(); - lastNodeStatus = {status.code(), - str::stream() << "can't authenticate against replica set node " - << _lastSlaveOkHost - << ": " - << status.reason()}; + lastNodeStatus = + ex.toStatus(str::stream() << "can't authenticate against replica set node " + << _lastSlaveOkHost); _invalidateLastSlaveOkCache(lastNodeStatus); } } @@ -464,7 +461,7 @@ void DBClientReplicaSet::_auth(const BSONObj& params) { assertMsgB << "Failed to authenticate, no good nodes in " << _getMonitor()->getName(); uasserted(ErrorCodes::NodeNotFound, assertMsgB.str()); } else { - uasserted(lastNodeStatus.code(), lastNodeStatus.reason()); + uassertStatusOK(lastNodeStatus); } } @@ -1006,10 +1003,8 @@ bool DBClientReplicaSet::call(Message& toSend, *actualServer = ""; const Status status = ex.toStatus(); - _invalidateLastSlaveOkCache( - {status.code(), - str::stream() << "can't call replica set node " << _lastSlaveOkHost << ": " - << status.reason()}); + _invalidateLastSlaveOkCache(status.withContext( + str::stream() << "can't call replica set node " << _lastSlaveOkHost)); } } |