diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2017-04-17 17:59:05 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2017-04-17 17:59:05 -0400 |
commit | 587cb82bb403ec6a71dfac69375e1184b34087ac (patch) | |
tree | feee1816fb2e5009561d78e553a90b0869668102 | |
parent | fe4cdfccee8fa2657f6f97413893bb9846571a0c (diff) | |
download | mongo-587cb82bb403ec6a71dfac69375e1184b34087ac.tar.gz |
SERVER-25517 PerfCounterCollection shouldn't use ErrorCodes::DuplicateKeyValue
(cherry picked from commit 1f910deee89439ed6edb3bea40a7712df3a78e1b)
-rw-r--r-- | src/mongo/util/perfctr_collect.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mongo/util/perfctr_collect.cpp b/src/mongo/util/perfctr_collect.cpp index 57dfd34582c..3a0790cffb7 100644 --- a/src/mongo/util/perfctr_collect.cpp +++ b/src/mongo/util/perfctr_collect.cpp @@ -127,8 +127,7 @@ StatusWith<std::vector<std::string>> PerfCounterCollection::checkCounters( StringData name, const std::vector<StringData>& paths) { if (_counters.find(name.toString()) != _counters.end() || _nestedCounters.find(name.toString()) != _nestedCounters.end()) { - return Status(ErrorCodes::DuplicateKeyValue, - str::stream() << "Duplicate group name for " << name); + return Status(ErrorCodes::BadValue, str::stream() << "Duplicate group name for " << name); } std::vector<std::string> stringPaths; @@ -138,7 +137,7 @@ StatusWith<std::vector<std::string>> PerfCounterCollection::checkCounters( std::sort(stringPaths.begin(), stringPaths.end()); if (std::unique(stringPaths.begin(), stringPaths.end()) != stringPaths.end()) { - return Status(ErrorCodes::DuplicateKeyValue, + return Status(ErrorCodes::BadValue, str::stream() << "Duplicate counters in paths specified"); } |