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:
parent
a3475be9de
commit
4875e282d1
@ -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;
|
||||
}
|
||||
|
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user