void WriteOp::setOpError( const BatchedErrorDetail& error ) { dassert( _state == WriteOpState_Ready ); _error.reset( new BatchedErrorDetail ); error.cloneTo( _error.get() ); _state = WriteOpState_Error; // No need to updateOpState, set directly }
void WriteOp::noteWriteError( const TargetedWrite& targetedWrite, const BatchedErrorDetail& error ) { const WriteOpRef& ref = targetedWrite.writeOpRef; ChildWriteOp& childOp = *_childOps.at( ref.second ); childOp.pendingWrite = NULL; childOp.endpoint.reset( new ShardEndpoint( targetedWrite.endpoint ) ); childOp.error.reset( new BatchedErrorDetail ); error.cloneTo( childOp.error.get() ); childOp.state = WriteOpState_Error; updateOpState(); }