summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/get_last_error.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2017-06-23 10:45:48 -0400
committerMathias Stearn <mathias@10gen.com>2017-07-13 16:53:12 -0400
commit8d555140ce24b9f59e4672a0ed026502fdfffd2c (patch)
tree0ad245d9c2cfb93a80c4978a475cd1a78e35d52e /src/mongo/db/commands/get_last_error.cpp
parentb6abff538f84abecae2bd7137173a37a8626ac14 (diff)
downloadmongo-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/get_last_error.cpp')
-rw-r--r--src/mongo/db/commands/get_last_error.cpp16
1 files changed, 7 insertions, 9 deletions
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();