summaryrefslogtreecommitdiff
path: root/src/mongo/bson
diff options
context:
space:
mode:
authorBen Shteinfeld <ben.shteinfeld@mongodb.com>2017-06-07 11:15:23 -0400
committerBen Shteinfeld <ben.shteinfeld@mongodb.com>2017-08-04 11:01:41 -0400
commit1599ba40e091bcf356bf0231bf32333397f07753 (patch)
tree160b6407430fbc3540a9f027e157f9efe35323f8 /src/mongo/bson
parentd88b75291089b0866dde85678447288e58d2d651 (diff)
downloadmongo-1599ba40e091bcf356bf0231bf32333397f07753.tar.gz
SERVER-13362 Change BSONElement::chk() to take a BSONType and use uassert
Diffstat (limited to 'src/mongo/bson')
-rw-r--r--src/mongo/bson/bsonelement.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/bson/bsonelement.h b/src/mongo/bson/bsonelement.h
index add268f1a1d..003b1ff5763 100644
--- a/src/mongo/bson/bsonelement.h
+++ b/src/mongo/bson/bsonelement.h
@@ -88,7 +88,7 @@ public:
*/
using DeferredComparison = BSONComparatorInterfaceBase<BSONElement>::DeferredComparison;
- /** These functions, which start with a capital letter, throw a MsgAssertionException if the
+ /** These functions, which start with a capital letter, throw if the
element is not of the required type. Example:
std::string foo = obj["foo"].String(); // std::exception if not a std::string type or DNE
@@ -690,19 +690,19 @@ private:
friend class BSONObjIterator;
friend class BSONObj;
- const BSONElement& chk(int t) const {
+ const BSONElement& chk(BSONType t) const {
if (t != type()) {
StringBuilder ss;
if (eoo())
ss << "field not found, expected type " << t;
else
ss << "wrong type for field (" << fieldName() << ") " << type() << " != " << t;
- msgasserted(13111, ss.str());
+ uasserted(13111, ss.str());
}
return *this;
}
const BSONElement& chk(bool expr) const {
- massert(13118, "unexpected or missing type value in BSON object", expr);
+ uassert(13118, "unexpected or missing type value in BSON object", expr);
return *this;
}
};