diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-12-10 13:54:21 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-12-10 13:54:21 -0500 |
commit | 3d055367324c74cf51bbf717501574a7238ee687 (patch) | |
tree | bb0bff1f6b5301592cccac78c69d348b4a2c286b /db/cloner.cpp | |
parent | a74353b6f15331125206c0db17695c66a3c3bcab (diff) | |
download | mongo-3d055367324c74cf51bbf717501574a7238ee687.tar.gz |
try to print out first element when cloing corrupt object
Diffstat (limited to 'db/cloner.cpp')
-rw-r--r-- | db/cloner.cpp | 12 |
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; } |