From c0b7158e31d10155a1285f989beae7bb03a5768e Mon Sep 17 00:00:00 2001 From: Ben Becker Date: Tue, 12 Feb 2013 15:59:50 -0800 Subject: SERVER-8234: make invoke() throw on error (v8 only) --- src/mongo/dbtests/jstests.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/mongo/dbtests/jstests.cpp') diff --git a/src/mongo/dbtests/jstests.cpp b/src/mongo/dbtests/jstests.cpp index 02e89962f98..5e5bd597ee2 100644 --- a/src/mongo/dbtests/jstests.cpp +++ b/src/mongo/dbtests/jstests.cpp @@ -194,7 +194,12 @@ namespace JSTests { ASSERT( !_logger.logged() ); // An error is logged for an invalid statement. - ASSERT_NOT_EQUALS( 0, scope->invoke( "notAFunction()", 0, 0 ) ); + try { + scope->invoke( "notAFunction()", 0, 0 ); + } + catch(const DBException&) { + // ignore the exception; just test that we logged something + } ASSERT( _logger.logged() ); } private: -- cgit v1.2.1