summaryrefslogtreecommitdiff
path: root/db/cloner.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-12-10 13:54:21 -0500
committerEliot Horowitz <eliot@10gen.com>2009-12-10 13:54:21 -0500
commit3d055367324c74cf51bbf717501574a7238ee687 (patch)
treebb0bff1f6b5301592cccac78c69d348b4a2c286b /db/cloner.cpp
parenta74353b6f15331125206c0db17695c66a3c3bcab (diff)
downloadmongo-3d055367324c74cf51bbf717501574a7238ee687.tar.gz
try to print out first element when cloing corrupt object
Diffstat (limited to 'db/cloner.cpp')
-rw-r--r--db/cloner.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/db/cloner.cpp b/db/cloner.cpp
index ea2f00396d1..0a136440033 100644
--- a/db/cloner.cpp
+++ b/db/cloner.cpp
@@ -110,7 +110,17 @@ namespace mongo {
/* assure object is valid. note this will slow us down a little. */
if ( !tmp.valid() ) {
- out() << "skipping corrupt object from " << from_collection << '\n';
+ stringstream ss;
+ ss << "skipping corrupt object from " << from_collection;
+ BSONElement e = tmp.firstElement();
+ try {
+ e.validate();
+ ss << " firstElement: " << e;
+ }
+ catch( ... ){
+ ss << " firstElement corrupt";
+ }
+ out() << ss.str() << endl;
continue;
}