summaryrefslogtreecommitdiff
path: root/stdafx.cpp
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2009-01-05 15:30:07 -0500
committerDwight <dmerriman@gmail.com>2009-01-05 15:30:07 -0500
commit2e35206b4781ee72378ddddc4c2f99a1c290ab58 (patch)
tree9fc17cd26512cc9680d13b11cd196369908cca97 /stdafx.cpp
parentffc3bb2216da756a77c18065a52c3cc1bb694cd3 (diff)
downloadmongo-2e35206b4781ee72378ddddc4c2f99a1c290ab58.tar.gz
getlasterror
Diffstat (limited to 'stdafx.cpp')
-rw-r--r--stdafx.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/stdafx.cpp b/stdafx.cpp
index 68eb37a2210..a5572b442be 100644
--- a/stdafx.cpp
+++ b/stdafx.cpp
@@ -29,6 +29,7 @@ Assertion lastAssert[4];
#undef yassert
#include "assert.h"
+#include "db/lasterror.h"
string getDbContext();
void sayDbContext(const char *errmsg = 0);
@@ -37,12 +38,14 @@ void sayDbContext(const char *errmsg = 0);
void wasserted(const char *msg, const char *file, unsigned line) {
problem() << "Assertion failure " << msg << ' ' << file << ' ' << dec << line << endl;
sayDbContext();
+ raiseError(msg && *msg ? msg : "wassertion failure");
lastAssert[1].set(msg, getDbContext().c_str(), file, line);
}
void asserted(const char *msg, const char *file, unsigned line) {
problem() << "Assertion failure " << msg << ' ' << file << ' ' << dec << line << endl;
sayDbContext();
+ raiseError(msg && *msg ? msg : "assertion failure");
lastAssert[0].set(msg, getDbContext().c_str(), file, line);
throw AssertionException();
}
@@ -54,12 +57,14 @@ void uasserted(const char *msg) {
else
RARELY problem() << "User Assertion " << msg << endl;
lastAssert[3].set(msg, getDbContext().c_str(), "", 0);
+ raiseError(msg);
throw UserAssertionException(msg);
}
void msgasserted(const char *msg) {
log() << "Assertion: " << msg << '\n';
lastAssert[2].set(msg, getDbContext().c_str(), "", 0);
+ raiseError(msg && *msg ? msg : "massert failure");
throw MsgAssertionException(msg);
}