summaryrefslogtreecommitdiff
path: root/src/mongo/util/assert_util.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2016-02-23 12:57:10 -0500
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2016-02-24 17:01:04 -0500
commite7c8e17220ef32befa8673bd776ba381b1911496 (patch)
tree18ea08c73c12ba756a4a661a6a21dd4b97700971 /src/mongo/util/assert_util.cpp
parentcf58ea6426f3bfb5dfbc21700c1c46d32a0bbecc (diff)
downloadmongo-e7c8e17220ef32befa8673bd776ba381b1911496.tar.gz
SERVER-22783 Consolidate WriteConcernError parsing
This change consolidates the checking for writeConcernError section to happen in the ShardRegistry instead of each command doing it separately. This makes WriteConcernFailed to be an actual error code of the command. Also cleans up the WCErrorDetail class by removing unnecessarly functionality.
Diffstat (limited to 'src/mongo/util/assert_util.cpp')
-rw-r--r--src/mongo/util/assert_util.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/util/assert_util.cpp b/src/mongo/util/assert_util.cpp
index 5a715f5b28b..7125396f5be 100644
--- a/src/mongo/util/assert_util.cpp
+++ b/src/mongo/util/assert_util.cpp
@@ -90,9 +90,10 @@ void DBException::traceIfNeeded(const DBException& e) {
}
ErrorCodes::Error DBException::convertExceptionCode(int exCode) {
- if (exCode == 0)
+ if (exCode == 0) {
return ErrorCodes::UnknownError;
- return static_cast<ErrorCodes::Error>(exCode);
+ }
+ return ErrorCodes::fromInt(exCode);
}
void ExceptionInfo::append(BSONObjBuilder& b, const char* m, const char* c) const {