From 1681f080f05df5a04fc7228e66cf40494e345125 Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Mon, 24 Aug 2009 11:07:44 -0400 Subject: better error message for reduce failure MINOR --- db/dbcommands.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db/dbcommands.cpp b/db/dbcommands.cpp index f7e39afc2d4..0c6cb0dbc34 100644 --- a/db/dbcommands.cpp +++ b/db/dbcommands.cpp @@ -1169,7 +1169,9 @@ namespace mongo { s->setObject( "obj" , obj , true ); s->setNumber( "n" , n - 1 ); - uassert( "reduce invoke failed" , s->invoke( f , BSONObj() , 0 , true ) == 0 ); + if ( s->invoke( f , BSONObj() , 0 , true ) ){ + throw UserException( (string)"reduce invoke failed: " + s->getError() ); + } } result.appendArray( "retval" , s->getObject( "$arr" ) ); -- cgit v1.2.1