diff options
author | Xiangyu Yao <xiangyu.yao@mongodb.com> | 2018-05-15 13:18:29 -0400 |
---|---|---|
committer | Xiangyu Yao <xiangyu.yao@mongodb.com> | 2018-05-16 11:16:12 -0400 |
commit | e205726dd5ea4effac7466efc35a9eb52fdb618d (patch) | |
tree | ecdcd2cba1a8ee583ba1496f2e47c01fd1ac2fd9 /src/mongo/db/index_builder.cpp | |
parent | 05640e4e0752370650ea2f3c950b7a493b57dc46 (diff) | |
download | mongo-e205726dd5ea4effac7466efc35a9eb52fdb618d.tar.gz |
SERVER-34847 Catch all DBExceptions in index builder
Diffstat (limited to 'src/mongo/db/index_builder.cpp')
-rw-r--r-- | src/mongo/db/index_builder.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/index_builder.cpp b/src/mongo/db/index_builder.cpp index 8dbef6caa25..44ba3150115 100644 --- a/src/mongo/db/index_builder.cpp +++ b/src/mongo/db/index_builder.cpp @@ -183,7 +183,7 @@ Status _failIndexBuild(MultiIndexBlock& indexer, Status status, bool allowBackgr Status IndexBuilder::_build(OperationContext* opCtx, Database* db, bool allowBackgroundBuilding, - Lock::DBLock* dbLock) const { + Lock::DBLock* dbLock) const try { const NamespaceString ns(_index["ns"].String()); Collection* coll = db->getCollection(opCtx, ns); @@ -258,5 +258,7 @@ Status IndexBuilder::_build(OperationContext* opCtx, } return Status::OK(); +} catch (const DBException& e) { + return e.toStatus(); } } |