0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00

better error message on drop()

This commit is contained in:
Dwight 2009-08-06 11:37:33 -04:00
parent a3475be9de
commit 4875e282d1
2 changed files with 7 additions and 1 deletions

View File

@ -215,6 +215,7 @@ namespace mongo {
// if running without auth, you must be on localhost
AuthenticationInfo *ai = authInfo.get();
if( ai == 0 || !ai->isLocalHost ) {
log() << "ignoring shutdown cmd from client, not from localhost and running without auth" << endl;
errmsg = "unauthorized [2]";
return false;
}

View File

@ -610,7 +610,12 @@ assert( !eloc.isNull() );
NamespaceDetails *d = nsdetails(name.c_str());
assert( d );
if ( d->nIndexes != 0 ) {
assert( deleteIndexes(d, name.c_str(), "*", errmsg, result, true) );
try {
assert( deleteIndexes(d, name.c_str(), "*", errmsg, result, true) );
}
catch( DBException& ) {
uasserted("drop: deleteIndexes for collection failed - consider trying repair");
}
assert( d->nIndexes == 0 );
}
result.append("ns", name.c_str());