summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2011-09-07 17:29:18 -0400
committerEliot Horowitz <eliot@10gen.com>2011-09-07 17:29:18 -0400
commit955eca2419545e5f79a690893a264bd2a226f4cb (patch)
tree165d6c07fb505513a65fdd58084b0d319c1f0a03 /scripting
parentfd0a54bb7361d72f6db7e374c38da60333a55d18 (diff)
downloadmongo-955eca2419545e5f79a690893a264bd2a226f4cb.tar.gz
fix v8 error reporting
Diffstat (limited to 'scripting')
-rw-r--r--scripting/v8_db.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripting/v8_db.cpp b/scripting/v8_db.cpp
index 740a149d3d2..bda549cece8 100644
--- a/scripting/v8_db.cpp
+++ b/scripting/v8_db.cpp
@@ -327,6 +327,8 @@ namespace mongo {
{
V8Unlock u;
cursor = conn->query( ns, q , nToReturn , nToSkip , haveFields ? &fields : 0, options | ( slaveOk ? QueryOption_SlaveOk : 0 ) , batchSize );
+ if ( ! cursor.get() )
+ return v8::ThrowException( v8::String::New( "error doing query: failed" ) );
}
v8::Function * cons = (v8::Function*)( *( mongo->Get( scope->getV8Str( "internalCursor" ) ) ) );
assert( cons );