summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXiangyu Yao <xiangyu.yao@mongodb.com>2018-05-15 13:18:29 -0400
committerXiangyu Yao <xiangyu.yao@mongodb.com>2018-05-16 11:16:12 -0400
commite205726dd5ea4effac7466efc35a9eb52fdb618d (patch)
treeecdcd2cba1a8ee583ba1496f2e47c01fd1ac2fd9 /src
parent05640e4e0752370650ea2f3c950b7a493b57dc46 (diff)
downloadmongo-e205726dd5ea4effac7466efc35a9eb52fdb618d.tar.gz
SERVER-34847 Catch all DBExceptions in index builder
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/index_builder.cpp4
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();
}
}