From 8d555140ce24b9f59e4672a0ed026502fdfffd2c Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Fri, 23 Jun 2017 10:45:48 -0400 Subject: SERVER-29731 get errmsg out of BasicCommand api It is now only used by commands deriving from ErrmsgCommandDeprecated. --- src/mongo/db/commands/get_last_error.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/mongo/db/commands/get_last_error.cpp') diff --git a/src/mongo/db/commands/get_last_error.cpp b/src/mongo/db/commands/get_last_error.cpp index 80ebfb78e8e..536e1d18814 100644 --- a/src/mongo/db/commands/get_last_error.cpp +++ b/src/mongo/db/commands/get_last_error.cpp @@ -73,16 +73,15 @@ public: bool run(OperationContext* opCtx, const string& db, const BSONObj& cmdObj, - string& errmsg, BSONObjBuilder& result) { LastError::get(opCtx->getClient()).reset(); return true; } } cmdResetError; -class CmdGetLastError : public BasicCommand { +class CmdGetLastError : public ErrmsgCommandDeprecated { public: - CmdGetLastError() : BasicCommand("getLastError", "getlasterror") {} + CmdGetLastError() : ErrmsgCommandDeprecated("getLastError", "getlasterror") {} virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; } @@ -103,11 +102,11 @@ public: << " { wtimeout:m} - timeout for w in m milliseconds"; } - bool run(OperationContext* opCtx, - const string& dbname, - const BSONObj& cmdObj, - string& errmsg, - BSONObjBuilder& result) { + bool errmsgRun(OperationContext* opCtx, + const string& dbname, + const BSONObj& cmdObj, + string& errmsg, + BSONObjBuilder& result) { // // Correct behavior here is very finicky. // @@ -314,7 +313,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, const BSONObj& cmdObj, - string& errmsg, BSONObjBuilder& result) { LastError* le = &LastError::get(opCtx->getClient()); le->disable(); -- cgit v1.2.1