# HG changeset patch # User Benjamin Golinvaux # Date 1570453777 -7200 # Node ID e160159b19057e967f3c8a397f23121fba969bcc # Parent 43bf09d73e03cc4f5a4ba44b8aa9aa0feb212d11 Fixed buggy return of stack data diff -r 43bf09d73e03 -r e160159b1905 Framework/StoneException.h --- a/Framework/StoneException.h Mon Oct 07 14:09:44 2019 +0200 +++ b/Framework/StoneException.h Mon Oct 07 15:09:37 2019 +0200 @@ -58,6 +58,8 @@ { } + virtual ~StoneException() {} + ErrorCode GetErrorCode() const { return errorCode_; @@ -111,6 +113,7 @@ { protected: int applicationErrorCode_; + mutable std::string errorMessage_; public: explicit StoneApplicationException(int applicationErrorCode) : @@ -126,7 +129,10 @@ virtual const char* What() const { - return boost::lexical_cast(applicationErrorCode_).c_str(); + if (errorMessage_.size() == 0) + errorMessage_ = boost::lexical_cast(applicationErrorCode_); + + return errorMessage_.c_str(); } }; }