summaryrefslogtreecommitdiff
path: root/s/strategy_shard.cpp
diff options
context:
space:
mode:
authorAlberto Lerner <alerner@10gen.com>2010-12-15 12:07:12 -0500
committerAlberto Lerner <alerner@10gen.com>2010-12-15 12:07:12 -0500
commit4d351c23f7eaaf5a03c103ad38edc053943a36d1 (patch)
treefdc2b10ccf6a6c05dd4f7b72d2a3c2e255bdeb45 /s/strategy_shard.cpp
parent2393123c66ee498d9c2770be31bcc92d47d47a40 (diff)
downloadmongo-4d351c23f7eaaf5a03c103ad38edc053943a36d1.tar.gz
log the collection name as well
Diffstat (limited to 's/strategy_shard.cpp')
-rw-r--r--s/strategy_shard.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/s/strategy_shard.cpp b/s/strategy_shard.cpp
index 831f4873892..0257b320bae 100644
--- a/s/strategy_shard.cpp
+++ b/s/strategy_shard.cpp
@@ -224,13 +224,19 @@ namespace mongo {
BSONObjIterator fields(op.embeddedObject());
while(fields.more()){
const string field = fields.next().fieldName();
- uassert(13123, "Can't modify shard key's value", ! manager->getShardKey().partOfShardKey(field));
+ uassert(13123,
+ str::stream() << "Can't modify shard key's value field" << field
+ << " for collection: " << manager->getns(),
+ ! manager->getShardKey().partOfShardKey(field));
}
}
} else if ( manager->hasShardKey( toupdate ) ){
- uassert( 8014, "cannot modify shard key", manager->getShardKey().compare( query , toupdate ) == 0 );
+ uassert( 8014,
+ str::stream() << "cannot modify shard key for collection: " << manager->getns(),
+ manager->getShardKey().compare( query , toupdate ) == 0 );
} else {
- uasserted(12376, "shard key must be in update object");
+ uasserted(12376,
+ str::stream() << "shard key must be in update object for collection: " << manager->getns() );
}
}