diff options
author | Mathias Stearn <mathias@10gen.com> | 2017-10-16 18:59:08 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2017-11-02 14:25:21 -0400 |
commit | a0ebc55db521792632fb3ece87edafec327cc2a9 (patch) | |
tree | b2098c89f241082a9c1a55ed69794eef210aa312 /src/mongo/db/ops | |
parent | 9f8696b5ba4c9310749c5c3f1ee082c5f663b5b0 (diff) | |
download | mongo-a0ebc55db521792632fb3ece87edafec327cc2a9.tar.gz |
SERVER-31622 Fix bad throws
Diffstat (limited to 'src/mongo/db/ops')
-rw-r--r-- | src/mongo/db/ops/write_ops_exec.cpp | 13 |
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) |