summaryrefslogtreecommitdiff
path: root/src/mongo/db/ops/write_ops_exec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/ops/write_ops_exec.cpp')
-rw-r--r--src/mongo/db/ops/write_ops_exec.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mongo/db/ops/write_ops_exec.cpp b/src/mongo/db/ops/write_ops_exec.cpp
index 4cf25eafbad..27e53a898c9 100644
--- a/src/mongo/db/ops/write_ops_exec.cpp
+++ b/src/mongo/db/ops/write_ops_exec.cpp
@@ -509,12 +509,13 @@ WriteResult performInserts(OperationContext* opCtx, const write_ops::Insert& who
if (canContinue && !fixedDoc.isOK()) {
globalOpCounters.gotInsert();
- canContinue = handleError(
- opCtx,
- AssertionException(fixedDoc.getStatus().code(), fixedDoc.getStatus().reason()),
- wholeOp.getNamespace(),
- wholeOp.getWriteCommandBase(),
- &out);
+ try {
+ uassertStatusOK(fixedDoc.getStatus());
+ MONGO_UNREACHABLE;
+ } catch (const DBException& ex) {
+ canContinue = handleError(
+ opCtx, ex, wholeOp.getNamespace(), wholeOp.getWriteCommandBase(), &out);
+ }
}
if (!canContinue)