diff options
Diffstat (limited to 'src/mongo/db/pipeline/document_source_cursor.cpp')
-rw-r--r-- | src/mongo/db/pipeline/document_source_cursor.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/mongo/db/pipeline/document_source_cursor.cpp b/src/mongo/db/pipeline/document_source_cursor.cpp index 10d049cef28..10fe39a1484 100644 --- a/src/mongo/db/pipeline/document_source_cursor.cpp +++ b/src/mongo/db/pipeline/document_source_cursor.cpp @@ -133,23 +133,15 @@ void DocumentSourceCursor::loadBatch() { case PlanExecutor::ADVANCED: case PlanExecutor::IS_EOF: return; // We've reached our limit or exhausted the cursor. - case PlanExecutor::DEAD: { - _execStatus = - Status(ErrorCodes::QueryPlanKilled, - str::stream() << "collection or index disappeared when cursor yielded: " - << WorkingSetCommon::toStatusString(resultObj)); - break; - } + case PlanExecutor::DEAD: case PlanExecutor::FAILURE: { - _execStatus = Status(ErrorCodes::Error(17285), - str::stream() << "cursor encountered an error: " - << WorkingSetCommon::toStatusString(resultObj)); - break; + _execStatus = WorkingSetCommon::getMemberObjectStatus(resultObj).withContext( + "Error in $cursor stage"); + uassertStatusOK(_execStatus); } default: MONGO_UNREACHABLE; } - uassertStatusOK(_execStatus); } Pipeline::SourceContainer::iterator DocumentSourceCursor::doOptimizeAt( |