summaryrefslogtreecommitdiff
path: root/db/pipeline/document_source_limit.cpp
diff options
context:
space:
mode:
authorU-tellus\cwestin <cwestin@10gen.com>2011-12-12 16:33:49 -0800
committerU-tellus\cwestin <cwestin@10gen.com>2011-12-12 17:12:07 -0800
commit42d73f841cadcfc42ed028e2b40547d1b70688ba (patch)
tree12464253975e4912fc71cc41d6490aefe8cf2272 /db/pipeline/document_source_limit.cpp
parentfeedad9a2d03102ce052083cedb7709b5cd87d73 (diff)
downloadmongo-42d73f841cadcfc42ed028e2b40547d1b70688ba.tar.gz
assign error codes
Diffstat (limited to 'db/pipeline/document_source_limit.cpp')
-rw-r--r--db/pipeline/document_source_limit.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/db/pipeline/document_source_limit.cpp b/db/pipeline/document_source_limit.cpp
index 1054f367eec..a73d4da2005 100644
--- a/db/pipeline/document_source_limit.cpp
+++ b/db/pipeline/document_source_limit.cpp
@@ -68,13 +68,15 @@ namespace mongo {
intrusive_ptr<DocumentSource> DocumentSourceLimit::createFromBson(
BSONElement *pBsonElement,
const intrusive_ptr<ExpressionContext> &pCtx) {
- assert(pBsonElement->isNumber()); // CW TODO must be a number
+ uassert(15957, "the limit must be specified as a number",
+ pBsonElement->isNumber());
intrusive_ptr<DocumentSourceLimit> pLimit(
DocumentSourceLimit::create(pCtx));
pLimit->limit = (int)pBsonElement->numberLong();
- assert(pLimit->limit > 0); // CW TODO error code
+ uassert(15958, "the limit must be positive",
+ pLimit->limit > 0);
return pLimit;
}