changeset 1036:d7d3227c11a9

merge
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 07 Oct 2019 15:26:29 +0200
parents 01631b65837c (current diff) 839d2bff92ab (diff)
children 4e713ef78a5a
files
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Mon Oct 07 15:26:16 2019 +0200
+++ b/.hgtags	Mon Oct 07 15:26:29 2019 +0200
@@ -32,3 +32,4 @@
 53cc787bd7bce69639a6003ee20c8a2b304030e4 toa2019092301
 ac88989817e3b4249ebab6a824466bbb62f70452 toa2019093001
 7b89e88bb66ebd3cd89d414d1010310c7d4cfbac toa2019100701
+e160159b19057e967f3c8a397f23121fba969bcc toa2019100702
--- a/Framework/StoneException.h	Mon Oct 07 15:26:16 2019 +0200
+++ b/Framework/StoneException.h	Mon Oct 07 15:26:29 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<std::string>(applicationErrorCode_).c_str();
+      if (errorMessage_.size() == 0)
+        errorMessage_ = boost::lexical_cast<std::string>(applicationErrorCode_);
+
+      return errorMessage_.c_str();
     }
   };
 }