summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-06-10 13:27:51 -0400
committerEliot Horowitz <eliot@10gen.com>2010-06-10 13:27:51 -0400
commit3a155378c5d89b5f25a4627bb72bc3dd76109935 (patch)
tree8388ce1276222c3d0539a90afa9cde4c45989dba /scripting
parentb9b46615b989787a3b2009a7f445f9dc82aa7727 (diff)
downloadmongo-3a155378c5d89b5f25a4627bb72bc3dd76109935.tar.gz
slightly better error reporting for load
Diffstat (limited to 'scripting')
-rw-r--r--scripting/engine_spidermonkey.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripting/engine_spidermonkey.cpp b/scripting/engine_spidermonkey.cpp
index 87010f22067..c3cbf2548b9 100644
--- a/scripting/engine_spidermonkey.cpp
+++ b/scripting/engine_spidermonkey.cpp
@@ -1373,6 +1373,15 @@ namespace mongo {
JSBool worked = JS_EvaluateScript( _context , _global , code.c_str() , strlen( code.c_str() ) , name.c_str() , 0 , &ret );
uninstallCheckTimeout( timeoutMs );
+ if ( ! worked && _error.size() == 0 ){
+ jsval v;
+ if ( JS_GetPendingException( _context , &v ) ){
+ _error = _convertor->toString( v );
+ if ( reportError )
+ cout << _error << endl;
+ }
+ }
+
if ( assertOnError )
uassert( 10228 , name + " exec failed" , worked );