summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-12-21 10:58:20 -0500
committerEliot Horowitz <eliot@10gen.com>2009-12-29 14:26:12 -0500
commitf8f12e8d13c5ea15a224208c3425d7162b44f85f (patch)
tree13944ee5e4948e25976e34b4aec2e0968f7734cd
parent720eecdc012df963c59c960c5020f25762d02bb7 (diff)
downloadmongo-f8f12e8d13c5ea15a224208c3425d7162b44f85f.tar.gz
beter error handling in m/r
-rw-r--r--db/mr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/db/mr.cpp b/db/mr.cpp
index 58d28164d12..a9cb2a31a6a 100644
--- a/db/mr.cpp
+++ b/db/mr.cpp
@@ -205,7 +205,13 @@ namespace mongo {
scope->localConnect( setup.dbname.c_str() );
map = scope->createFunction( setup.mapCode.c_str() );
+ if ( ! map )
+ throw UserException( (string)"map compile failed: " + scope->getError() );
+
reduce = scope->createFunction( setup.reduceCode.c_str() );
+ if ( ! reduce )
+ throw UserException( (string)"reduce compile failed: " + scope->getError() );
+
if ( setup.finalizeCode.size() )
finalize = scope->createFunction( setup.finalizeCode.c_str() );
else