diff options
author | dwight <dwight@10gen.com> | 2011-01-19 17:31:52 -0500 |
---|---|---|
committer | dwight <dwight@10gen.com> | 2011-01-19 17:31:52 -0500 |
commit | c00ed72c02f09ee24223119401e70979aa2d6691 (patch) | |
tree | b7fadadc68d0a63d1abe6b6392923eea6ee07f41 /db | |
parent | 39e8457350089ffb7c40ae77142dd1f5eed295f9 (diff) | |
download | mongo-c00ed72c02f09ee24223119401e70979aa2d6691.tar.gz |
defensive
Diffstat (limited to 'db')
-rw-r--r-- | db/dbcommands.cpp | 14 |
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; |