diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-06-10 13:27:51 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-06-10 13:27:51 -0400 |
commit | 3a155378c5d89b5f25a4627bb72bc3dd76109935 (patch) | |
tree | 8388ce1276222c3d0539a90afa9cde4c45989dba /scripting | |
parent | b9b46615b989787a3b2009a7f445f9dc82aa7727 (diff) | |
download | mongo-3a155378c5d89b5f25a4627bb72bc3dd76109935.tar.gz |
slightly better error reporting for load
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/engine_spidermonkey.cpp | 9 |
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 ); |