summaryrefslogtreecommitdiff
path: root/jstests/error2.js
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2009-04-08 12:11:34 -0400
committerAaron <aaron@10gen.com>2009-04-08 12:11:34 -0400
commit78625e7616ee39b19bbde08744a7550c8a424d07 (patch)
tree5f59391f4ec3a6e34034f79de9a81a404a934162 /jstests/error2.js
parent94e12ec06b6e784f319a23e77921cd3ce28918f9 (diff)
downloadmongo-78625e7616ee39b19bbde08744a7550c8a424d07.tar.gz
forward stack trace to client when $where throws exception
Diffstat (limited to 'jstests/error2.js')
-rw-r--r--jstests/error2.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/jstests/error2.js b/jstests/error2.js
new file mode 100644
index 00000000000..5f2f5387424
--- /dev/null
+++ b/jstests/error2.js
@@ -0,0 +1,20 @@
+// Test that client gets stack trace on failed invoke
+
+f = db.jstests_error2;
+
+f.drop();
+
+f.save( {a:1} );
+
+c = f.find({$where : function(){ return a() }});
+try {
+ c.next();
+} catch( e ) {
+ assert( e.match( /java.lang.NullPointerException/ ) );
+}
+
+try {
+ db.eval( function() { return a(); } );
+} catch ( e ) {
+ assert( e.match( /java.lang.NullPointerException/ ) );
+}