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/namespace_string.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/namespace_string.cpp')
-rw-r--r-- | src/mongo/db/namespace_string.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/mongo/db/namespace_string.cpp b/src/mongo/db/namespace_string.cpp index 970b0be8e2a..a6ae64728e9 100644 --- a/src/mongo/db/namespace_string.cpp +++ b/src/mongo/db/namespace_string.cpp @@ -210,10 +210,8 @@ StatusWith<repl::OpTime> NamespaceString::getDropPendingNamespaceOpTime() const long long seconds; auto status = parseNumberFromString(opTimeStr.substr(0, incrementSeparatorIndex), &seconds); if (!status.isOK()) { - return Status( - status.code(), - str::stream() << "Invalid timestamp seconds in drop-pending namespace: " << _ns << ": " - << status.reason()); + return status.withContext( + str::stream() << "Invalid timestamp seconds in drop-pending namespace: " << _ns); } unsigned int increment; @@ -222,19 +220,15 @@ StatusWith<repl::OpTime> NamespaceString::getDropPendingNamespaceOpTime() const termSeparatorIndex - (incrementSeparatorIndex + 1)), &increment); if (!status.isOK()) { - return Status(status.code(), - str::stream() << "Invalid timestamp increment in drop-pending namespace: " - << _ns - << ": " - << status.reason()); + return status.withContext( + str::stream() << "Invalid timestamp increment in drop-pending namespace: " << _ns); } long long term; status = mongo::parseNumberFromString(opTimeStr.substr(termSeparatorIndex + 1), &term); if (!status.isOK()) { - return Status(status.code(), - str::stream() << "Invalid term in drop-pending namespace: " << _ns << ": " - << status.reason()); + return status.withContext(str::stream() << "Invalid term in drop-pending namespace: " + << _ns); } return repl::OpTime(Timestamp(Seconds(seconds), increment), term); |