diff options
author | Adam Midvidy <amidvidy@gmail.com> | 2015-04-09 17:43:44 -0400 |
---|---|---|
committer | Adam Midvidy <amidvidy@gmail.com> | 2015-04-10 09:19:44 -0400 |
commit | cb65a822aa0d620afb36ea8d29104c7dc2644d2f (patch) | |
tree | f13a32d124857f9ae534e170fc7441a4e36f22f5 /src/mongo/util/assert_util.h | |
parent | 3936e6af141666a9c6a29ce14acfd4dff3954321 (diff) | |
download | mongo-cb65a822aa0d620afb36ea8d29104c7dc2644d2f.tar.gz |
SERVER-17802 add fassertStatusOK
Diffstat (limited to 'src/mongo/util/assert_util.h')
-rw-r--r-- | src/mongo/util/assert_util.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/util/assert_util.h b/src/mongo/util/assert_util.h index bb0f9f17cb8..572c9c8e7c9 100644 --- a/src/mongo/util/assert_util.h +++ b/src/mongo/util/assert_util.h @@ -250,6 +250,14 @@ namespace mongo { return std::move(sw.getValue()); } + template<typename T> + inline T fassertStatusOK(int msgid, StatusWith<T> sw) { + if (MONGO_unlikely(!sw.isOK())) { + fassertFailedWithStatus(msgid, sw.getStatus()); + } + return std::move(sw.getValue()); + } + /* warning only - keeps going */ #define MONGO_wassert(_Expression) do { \ if (MONGO_unlikely(!(_Expression))) { \ |