diff options
author | dwight <dwight@Dwights-MacBook.local> | 2008-10-04 22:28:49 -0400 |
---|---|---|
committer | dwight <dwight@Dwights-MacBook.local> | 2008-10-04 22:28:49 -0400 |
commit | 2f9c588ef69ebffc9b0d3f724095025d5fc62720 (patch) | |
tree | 7b5979cab80b31753993a2d11b31a56291dd2127 | |
parent | 3028627f01ce095b3ba493744b824ba8a03899a6 (diff) | |
download | mongo-2f9c588ef69ebffc9b0d3f724095025d5fc62720.tar.gz |
report $where errors
-rw-r--r-- | db/matcher.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/db/matcher.cpp b/db/matcher.cpp index f88015da275..97f9bac7828 100644 --- a/db/matcher.cpp +++ b/db/matcher.cpp @@ -410,8 +410,10 @@ bool JSMatcher::matches(JSObj& jsobj, bool *deep) { } if( where ) { - if( where->func == 0 ) - return false; // didn't compile + if( where->func == 0 ) { + uassert("compile failure", false); + return false; // didn't compile + } /**if( 1 || jsobj.objsize() < 200 || where->fullObject ) */ { @@ -427,8 +429,10 @@ bool JSMatcher::matches(JSObj& jsobj, bool *deep) { JSObj temp = b.done(); JavaJS->scopeSetObject(where->scope, "obj", &temp); }*/ - if( JavaJS->invoke(where->scope, where->func) ) - return false; + if( JavaJS->invoke(where->scope, where->func) ) { + uassert("error in invocation of $where function", false); + return false; + } return JavaJS->scopeGetBoolean(where->scope, "return") != 0; } |