summaryrefslogtreecommitdiff
path: root/db/dbcommands.cpp
diff options
context:
space:
mode:
authordwight <dwight@10gen.com>2011-01-19 17:31:52 -0500
committerdwight <dwight@10gen.com>2011-01-19 17:31:52 -0500
commitc00ed72c02f09ee24223119401e70979aa2d6691 (patch)
treeb7fadadc68d0a63d1abe6b6392923eea6ee07f41 /db/dbcommands.cpp
parent39e8457350089ffb7c40ae77142dd1f5eed295f9 (diff)
downloadmongo-c00ed72c02f09ee24223119401e70979aa2d6691.tar.gz
defensive
Diffstat (limited to 'db/dbcommands.cpp')
-rw-r--r--db/dbcommands.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/db/dbcommands.cpp b/db/dbcommands.cpp
index 992c6432ab9..c5707bb1bd4 100644
--- a/db/dbcommands.cpp
+++ b/db/dbcommands.cpp
@@ -906,7 +906,19 @@ namespace mongo {
CmdCloseAllDatabases() : Command( "closeAllDatabases" ) {}
bool run(const string& dbname , BSONObj& jsobj, string& errmsg, BSONObjBuilder& result, bool /*fromRepl*/) {
- return dbHolder.closeAll( dbpath , result, false );
+ bool ok;
+ try {
+ ok = dbHolder.closeAll( dbpath , result, false );
+ }
+ catch(DBException&) {
+ throw;
+ }
+ catch(...) {
+ log() << "ERROR uncaught exception in command closeAllDatabases" << endl;
+ errmsg = "unexpected uncaught exception";
+ return false;
+ }
+ return ok;
}
} cmdCloseAllDatabases;