diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2018-03-26 17:03:57 -0400 |
---|---|---|
committer | Billy Donahue <billy.donahue@mongodb.com> | 2018-04-13 14:13:27 -0400 |
commit | 64f24ed205a4d83aece37c5f2c64af26624113c1 (patch) | |
tree | dba4eb4288562a5b75ab4201390f500bf665bc38 /src/mongo/db/commands.cpp | |
parent | 431ebb76fb1dfd296afd913f4d83b0387c89e992 (diff) | |
download | mongo-64f24ed205a4d83aece37c5f2c64af26624113c1.tar.gz |
SERVER-34148 TypedCommand
Diffstat (limited to 'src/mongo/db/commands.cpp')
-rw-r--r-- | src/mongo/db/commands.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/commands.cpp b/src/mongo/db/commands.cpp index 47b3cc15df6..276a471d5a0 100644 --- a/src/mongo/db/commands.cpp +++ b/src/mongo/db/commands.cpp @@ -334,6 +334,14 @@ void CommandReplyBuilder::reset() { getBodyBuilder().resetToEmpty(); } +void CommandReplyBuilder::fillFrom(const Status& status) { + if (!status.isOK()) { + reset(); + } + auto bob = getBodyBuilder(); + CommandHelpers::appendCommandStatus(bob, status); +} + ////////////////////////////////////////////////////////////// // CommandInvocation |