From 0ab8149a8e9e900b63ee28b9590a249578339376 Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Mon, 28 Dec 2009 16:43:43 -0500 Subject: uassert/massert take error code SERVER-112 --- tools/dump.cpp | 2 +- tools/import.cpp | 2 +- tools/restore.cpp | 4 ++-- tools/sniffer.cpp | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'tools') diff --git a/tools/dump.cpp b/tools/dump.cpp index 6fe8ae2234c..201cfc93ead 100644 --- a/tools/dump.cpp +++ b/tools/dump.cpp @@ -39,7 +39,7 @@ public: ofstream out; out.open( outputFile.string().c_str() , ios_base::out | ios_base::binary ); - uassert( "couldn't open file" , out.good() ); + uassert( 10262 , "couldn't open file" , out.good() ); ProgressMeter m( conn( true ).count( coll.c_str() , BSONObj() , Option_SlaveOk ) ); diff --git a/tools/import.cpp b/tools/import.cpp index 7a05cf095c8..9b43e4fa7fc 100644 --- a/tools/import.cpp +++ b/tools/import.cpp @@ -204,7 +204,7 @@ public: char line[ (1024 * 1024 * 4) + 128]; while ( *in ){ in->getline( line , BUF_SIZE ); - uassert( "unknown error reading file" , ( in->rdstate() & ios_base::badbit ) == 0 ); + uassert( 10263 , "unknown error reading file" , ( in->rdstate() & ios_base::badbit ) == 0 ); log(1) << "got line:" << line << endl; char * buf = line; diff --git a/tools/restore.cpp b/tools/restore.cpp index 82dd32743a0..19e3a26a9d3 100644 --- a/tools/restore.cpp +++ b/tools/restore.cpp @@ -151,7 +151,7 @@ public: if ( size >= BUF_SIZE ){ cerr << "got an object of size: " << size << " terminating..." << endl; } - uassert( "invalid object size" , size < BUF_SIZE ); + uassert( 10264 , "invalid object size" , size < BUF_SIZE ); file.read( buf + 4 , size - 4 ); @@ -166,7 +166,7 @@ public: free( buf ); - uassert( "counts don't match" , m.done() == fileLength ); + uassert( 10265 , "counts don't match" , m.done() == fileLength ); out() << "\t " << m.hits() << " objects" << endl; } }; diff --git a/tools/sniffer.cpp b/tools/sniffer.cpp index 26830d7d29d..9590d8fc8e9 100644 --- a/tools/sniffer.cpp +++ b/tools/sniffer.cpp @@ -370,8 +370,8 @@ int main(int argc, char **argv){ } else if ( arg == string( "--forward" ) ) { forwardAddress = args[ ++i ]; } else if ( arg == string( "--source" ) ) { - uassert( "can't use --source twice" , source == false ); - uassert( "source needs more args" , args.size() > i + 2); + uassert( 10266 , "can't use --source twice" , source == false ); + uassert( 10267 , "source needs more args" , args.size() > i + 2); source = true; replay = ( args[ ++i ] == string( "FILE" ) ); if ( replay ) -- cgit v1.2.1