diff options
author | Mathias Stearn <mathias@10gen.com> | 2017-06-23 10:45:48 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2017-07-13 16:53:12 -0400 |
commit | 8d555140ce24b9f59e4672a0ed026502fdfffd2c (patch) | |
tree | 0ad245d9c2cfb93a80c4978a475cd1a78e35d52e /src/mongo/db/commands/generic.cpp | |
parent | b6abff538f84abecae2bd7137173a37a8626ac14 (diff) | |
download | mongo-8d555140ce24b9f59e4672a0ed026502fdfffd2c.tar.gz |
SERVER-29731 get errmsg out of BasicCommand api
It is now only used by commands deriving from ErrmsgCommandDeprecated.
Diffstat (limited to 'src/mongo/db/commands/generic.cpp')
-rw-r--r-- | src/mongo/db/commands/generic.cpp | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/mongo/db/commands/generic.cpp b/src/mongo/db/commands/generic.cpp index a9b3e982c23..35998427356 100644 --- a/src/mongo/db/commands/generic.cpp +++ b/src/mongo/db/commands/generic.cpp @@ -92,7 +92,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, const BSONObj& jsobj, - std::string& errmsg, BSONObjBuilder& result) { VersionInfoInterface::instance().appendBuildInfo(&result); appendStorageEngineList(&result); @@ -121,7 +120,6 @@ public: virtual bool run(OperationContext* opCtx, const string& badns, const BSONObj& cmdObj, - string& errmsg, BSONObjBuilder& result) { // IMPORTANT: Don't put anything in here that might lock db - including authentication return true; @@ -146,7 +144,6 @@ public: virtual bool run(OperationContext* opCtx, const string& ns, const BSONObj& cmdObj, - string& errmsg, BSONObjBuilder& result) { if (getGlobalScriptEngine()) { BSONObjBuilder bb(result.subobjStart("js")); @@ -188,7 +185,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, const BSONObj& cmdObj, - string& errmsg, BSONObjBuilder& result) { ProcessInfo p; BSONObjBuilder bSys, bOs; @@ -235,7 +231,6 @@ public: virtual bool run(OperationContext* opCtx, const string& ns, const BSONObj& cmdObj, - string& errmsg, BSONObjBuilder& result) { bool didRotate = rotateLogs(serverGlobalParams.logRenameOnRotate); if (didRotate) @@ -266,7 +261,6 @@ public: virtual bool run(OperationContext* opCtx, const string& ns, const BSONObj& cmdObj, - string& errmsg, BSONObjBuilder& result) { // sort the commands before building the result BSON std::vector<Command*> commands; @@ -364,16 +358,15 @@ public: bool run(OperationContext* opCtx, const string& dbnamne, const BSONObj& cmdObj, - string& errmsg, BSONObjBuilder& result) { LastError::get(cc()).setLastError(10038, "forced error"); return false; } } cmdForceError; -class GetLogCmd : public BasicCommand { +class GetLogCmd : public ErrmsgCommandDeprecated { public: - GetLogCmd() : BasicCommand("getLog") {} + GetLogCmd() : ErrmsgCommandDeprecated("getLog") {} virtual bool slaveOk() const { return true; @@ -395,11 +388,11 @@ public: help << "{ getLog : '*' } OR { getLog : 'global' }"; } - virtual bool run(OperationContext* opCtx, - const string& dbname, - const BSONObj& cmdObj, - string& errmsg, - BSONObjBuilder& result) { + virtual bool errmsgRun(OperationContext* opCtx, + const string& dbname, + const BSONObj& cmdObj, + string& errmsg, + BSONObjBuilder& result) { BSONElement val = cmdObj.firstElement(); if (val.type() != String) { return appendCommandStatus( @@ -469,7 +462,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, const BSONObj& cmdObj, - string& errmsg, BSONObjBuilder& result) { std::string logName; Status status = bsonExtractStringField(cmdObj, "clearLog", &logName); @@ -521,7 +513,6 @@ public: virtual bool run(OperationContext* opCtx, const string&, const BSONObj& cmdObj, - string& errmsg, BSONObjBuilder& result) { result.append("argv", serverGlobalParams.argvArray); result.append("parsed", serverGlobalParams.parsedOpts); |