summaryrefslogtreecommitdiff
path: root/src/mongo/db/concurrency/deferred_writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/concurrency/deferred_writer.cpp')
-rw-r--r--src/mongo/db/concurrency/deferred_writer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/concurrency/deferred_writer.cpp b/src/mongo/db/concurrency/deferred_writer.cpp
index 6c0f0ed3c77..40f5422eb62 100644
--- a/src/mongo/db/concurrency/deferred_writer.cpp
+++ b/src/mongo/db/concurrency/deferred_writer.cpp
@@ -100,7 +100,7 @@ StatusWith<std::unique_ptr<AutoGetCollection>> DeferredWriter::_getCollection(
return std::move(agc);
}
-void DeferredWriter::_worker(InsertStatement stmt) {
+void DeferredWriter::_worker(InsertStatement stmt) try {
auto uniqueOpCtx = Client::getCurrent()->makeOperationContext();
OperationContext* opCtx = uniqueOpCtx.get();
auto result = _getCollection(opCtx);
@@ -133,6 +133,8 @@ void DeferredWriter::_worker(InsertStatement stmt) {
if (!status.isOK()) {
_logFailure(status);
}
+} catch (const DBException& e) {
+ _logFailure(e.toStatus());
}
DeferredWriter::DeferredWriter(NamespaceString nss, CollectionOptions opts, int64_t maxSize)