summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-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;