summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2010-04-22 18:43:37 -0400
committerDwight <dmerriman@gmail.com>2010-04-22 18:43:37 -0400
commitca84dc6bb13766a36d7348cdb38c0fad5f6a50ac (patch)
tree5df1696755f62eee591676a1ffa8936aa73dcc73 /util
parent0976928780396beb0e9c0b215e00ecaabe2a4a43 (diff)
downloadmongo-ca84dc6bb13766a36d7348cdb38c0fad5f6a50ac.tar.gz
cleaning
Diffstat (limited to 'util')
-rw-r--r--util/assert_util.cpp10
-rw-r--r--util/assert_util.h2
2 files changed, 10 insertions, 2 deletions
diff --git a/util/assert_util.cpp b/util/assert_util.cpp
index b4659ccd5e3..bc5e26c1eee 100644
--- a/util/assert_util.cpp
+++ b/util/assert_util.cpp
@@ -92,7 +92,15 @@ namespace mongo {
lastAssert[2].set(msg, getDbContext().c_str(), "", 0);
raiseError(msgid,msg && *msg ? msg : "massert failure");
breakpoint();
- printStackTrace(); // TEMP?? should we get rid of this? TODO
+ printStackTrace();
+ throw MsgAssertionException(msgid, msg);
+ }
+
+ void msgassertedNoTrace(int msgid, const char *msg) {
+ assertionCount.condrollover( ++assertionCount.warning );
+ log() << "Assertion: " << msgid << ":" << msg << endl;
+ lastAssert[2].set(msg, getDbContext().c_str(), "", 0);
+ raiseError(msgid,msg && *msg ? msg : "massert failure");
throw MsgAssertionException(msgid, msg);
}
diff --git a/util/assert_util.h b/util/assert_util.h
index bae3a55cbf1..0ca44a6b02e 100644
--- a/util/assert_util.h
+++ b/util/assert_util.h
@@ -150,6 +150,7 @@ namespace mongo {
void uasserted(int msgid, const char *msg);
inline void uasserted(int msgid , string msg) { uasserted(msgid, msg.c_str()); }
void uassert_nothrow(const char *msg); // reported via lasterror, but don't throw exception
+ void msgassertedNoTrace(int msgid, const char *msg);
void msgasserted(int msgid, const char *msg);
inline void msgasserted(int msgid, string msg) { msgasserted(msgid, msg.c_str()); }
@@ -160,7 +161,6 @@ namespace mongo {
#define assert(_Expression) (void)( (!!(_Expression)) || (mongo::asserted(#_Expression, __FILE__, __LINE__), 0) )
/* "user assert". if asserts, user did something wrong, not our code */
-//#define uassert( 10269 , _Expression) (void)( (!!(_Expression)) || (uasserted(#_Expression, __FILE__, __LINE__), 0) )
#define uassert(msgid, msg,_Expression) (void)( (!!(_Expression)) || (mongo::uasserted(msgid, msg), 0) )
#define xassert(_Expression) (void)( (!!(_Expression)) || (mongo::asserted(#_Expression, __FILE__, __LINE__), 0) )