summaryrefslogtreecommitdiff
path: root/src/mongo/db/sessions_collection_rs.h
diff options
context:
space:
mode:
authorMarcos José Grillo Ramírez <marcos.grillo@10gen.com>2019-10-29 12:07:54 +0000
committerevergreen <evergreen@mongodb.com>2019-10-29 12:07:54 +0000
commit81f52a69c92d27034ef3a9bf411fb463cab7643e (patch)
tree37a57eaa120a6a3c71a515a7f39dfceb21ee8cee /src/mongo/db/sessions_collection_rs.h
parentaf1a00179bd00083fd6d4c3af34140e4ba2aac6d (diff)
downloadmongo-81f52a69c92d27034ef3a9bf411fb463cab7643e.tar.gz
SERVER-42508 Convert SessionsCollection to throw instead of return status
Change the return value of checkSessionsCollectionExists from Status to void and throws exception on error
Diffstat (limited to 'src/mongo/db/sessions_collection_rs.h')
-rw-r--r--src/mongo/db/sessions_collection_rs.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/db/sessions_collection_rs.h b/src/mongo/db/sessions_collection_rs.h
index 93971948e2e..f87f48c217d 100644
--- a/src/mongo/db/sessions_collection_rs.h
+++ b/src/mongo/db/sessions_collection_rs.h
@@ -57,7 +57,7 @@ public:
/**
* Checks if the sessions collection exists and has the proper indexes.
*/
- Status checkSessionsCollectionExists(OperationContext* opCtx) override;
+ void checkSessionsCollectionExists(OperationContext* opCtx) override;
/**
* Updates the last-use times on the given sessions to be greater than
@@ -97,7 +97,8 @@ private:
static_assert(std::is_same_v<LocalReturnType, RemoteReturnType>,
"LocalCallback and RemoteCallback must have the same return type");
- using Type = RemoteReturnType;
+ using Type =
+ std::conditional_t<std::is_void<LocalReturnType>::value, void, LocalReturnType>;
};
template <typename LocalCallback, typename RemoteCallback>
using CommonResultT = typename CommonResult<LocalCallback, RemoteCallback>::Type;