diff options
author | Greg Studer <greg@10gen.com> | 2012-11-26 14:14:51 -0500 |
---|---|---|
committer | Greg Studer <greg@10gen.com> | 2012-12-03 17:01:19 -0500 |
commit | d26f22eb2e4280f3dc5713ab99da810208c783da (patch) | |
tree | 4e5c5dad16e365c63431111c41fb2942a4aae54b | |
parent | b8185fc4eac2726d0e850698ac100b9686f8755f (diff) | |
download | mongo-d26f22eb2e4280f3dc5713ab99da810208c783da.tar.gz |
SERVER-939 error handling for string*
-rw-r--r-- | src/mongo/util/assert_util.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/util/assert_util.h b/src/mongo/util/assert_util.h index 8d6e764cb8a..ed42107265b 100644 --- a/src/mongo/util/assert_util.h +++ b/src/mongo/util/assert_util.h @@ -175,6 +175,9 @@ namespace mongo { inline std::string causedBy( const DBException& e ){ return causedBy( e.toString().c_str() ); } inline std::string causedBy( const std::exception& e ){ return causedBy( e.what() ); } inline std::string causedBy( const std::string& e ){ return causedBy( e.c_str() ); } + inline std::string causedBy( const std::string* e ){ + return (e && *e != "") ? causedBy(*e) : ""; + } /** aborts on condition failure */ inline void fassert(int msgid, bool testOK) {if (MONGO_unlikely(!testOK)) fassertFailed(msgid);} |