summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/snapshot_management.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2018-05-02 17:32:34 -0400
committerMathias Stearn <mathias@10gen.com>2018-05-08 14:57:37 -0400
commitdb41862c5380ab33cf28db99726cdac252df0872 (patch)
treea0fefd08ea9cc063456abe796390faaaa07ec272 /src/mongo/db/commands/snapshot_management.cpp
parent2d35461cb54e35afea223714fab1a184a9b381e2 (diff)
downloadmongo-db41862c5380ab33cf28db99726cdac252df0872.tar.gz
SERVER-34628 Really remove appendCommandStatus
All remaining callers are transitioned to some form of usassert. This was done with an elaborate set of vim macros to make this tractable. Therefore it should not be considered an example of the best way to write new code, just as an improvement on what was there before. In particular, I couldn't easily remove Status's that are named then only used once in uassertStatusOK, nor could I convert the pattern of checking a StatusWith<T>'s getStatus() then calling getValue() to just call uassertStatusOK(returnsStatusWith()).
Diffstat (limited to 'src/mongo/db/commands/snapshot_management.cpp')
-rw-r--r--src/mongo/db/commands/snapshot_management.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mongo/db/commands/snapshot_management.cpp b/src/mongo/db/commands/snapshot_management.cpp
index 84c57af241b..b0b9896eb9b 100644
--- a/src/mongo/db/commands/snapshot_management.cpp
+++ b/src/mongo/db/commands/snapshot_management.cpp
@@ -73,8 +73,7 @@ public:
BSONObjBuilder& result) {
auto snapshotManager = getGlobalServiceContext()->getStorageEngine()->getSnapshotManager();
if (!snapshotManager) {
- return CommandHelpers::appendCommandStatus(result,
- {ErrorCodes::CommandNotSupported, ""});
+ uasserted(ErrorCodes::CommandNotSupported, "");
}
Lock::GlobalLock lk(opCtx, MODE_IX);
@@ -82,7 +81,7 @@ public:
auto name = LogicalClock::getClusterTimeForReplicaSet(opCtx).asTimestamp();
result.append("name", static_cast<long long>(name.asULL()));
- return CommandHelpers::appendCommandStatus(result, Status::OK());
+ return true;
}
};
@@ -117,8 +116,7 @@ public:
BSONObjBuilder& result) {
auto snapshotManager = getGlobalServiceContext()->getStorageEngine()->getSnapshotManager();
if (!snapshotManager) {
- return CommandHelpers::appendCommandStatus(result,
- {ErrorCodes::CommandNotSupported, ""});
+ uasserted(ErrorCodes::CommandNotSupported, "");
}
Lock::GlobalLock lk(opCtx, MODE_IX);