diff options
author | Mathias Stearn <mathias@10gen.com> | 2018-01-16 13:00:48 -0500 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2018-01-17 17:10:47 -0500 |
commit | daf6c4714b45aeb8ba1a09380135b3267c4cc280 (patch) | |
tree | c436a157d25ccb13f91746ba4e099a6396462115 /src/mongo/db/s/split_chunk.cpp | |
parent | 4dc36c7ccb6b5b8f7d865993b5d648fe6dc4b7c7 (diff) | |
download | mongo-daf6c4714b45aeb8ba1a09380135b3267c4cc280.tar.gz |
SERVER-32617 Fix code that reconstructs status with just code and string
Diffstat (limited to 'src/mongo/db/s/split_chunk.cpp')
-rw-r--r-- | src/mongo/db/s/split_chunk.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/s/split_chunk.cpp b/src/mongo/db/s/split_chunk.cpp index 7a34132f7ad..181fa43c1fa 100644 --- a/src/mongo/db/s/split_chunk.cpp +++ b/src/mongo/db/s/split_chunk.cpp @@ -144,10 +144,10 @@ StatusWith<boost::optional<ChunkRange>> splitChunk(OperationContext* opCtx, auto scopedDistLock = Grid::get(opCtx)->catalogClient()->getDistLockManager()->lock( opCtx, nss.ns(), whyMessage, DistLockManager::kSingleLockAttemptTimeout); if (!scopedDistLock.isOK()) { - errmsg = str::stream() << "could not acquire collection lock for " << nss.toString() - << " to split chunk " << chunkRange.toString() << " " - << causedBy(scopedDistLock.getStatus()); - return {scopedDistLock.getStatus().code(), errmsg}; + return scopedDistLock.getStatus().withContext( + str::stream() << "could not acquire collection lock for " << nss.toString() + << " to split chunk " + << chunkRange.toString()); } // If the shard key is hashed, then we must make sure that the split points are of type @@ -220,7 +220,7 @@ StatusWith<boost::optional<ChunkRange>> splitChunk(OperationContext* opCtx, << refreshStatus.toString(); warning() << redact(errmsg); - return {errorStatus.code(), errmsg}; + return errorStatus.withReason(errmsg); } } |