[Box Backup-commit] COMMIT r2399 - box/trunk/lib/common

boxbackup-dev at boxbackup.org boxbackup-dev at boxbackup.org
Fri Dec 5 20:32:50 GMT 2008


Author: chris
Date: 2008-12-05 20:32:50 +0000 (Fri, 05 Dec 2008)
New Revision: 2399

Modified:
   box/trunk/lib/common/makeexception.pl.in
Log:
Allow exceptions to contain a message string.


Modified: box/trunk/lib/common/makeexception.pl.in
===================================================================
--- box/trunk/lib/common/makeexception.pl.in	2008-12-05 20:32:09 UTC (rev 2398)
+++ box/trunk/lib/common/makeexception.pl.in	2008-12-05 20:32:50 UTC (rev 2399)
@@ -71,13 +71,14 @@
 class ${class}Exception : public BoxException
 {
 public:
-	${class}Exception(unsigned int SubType)
-		: mSubType(SubType)
+	${class}Exception(unsigned int SubType,
+		const std::string& rMessage = "")
+	: mSubType(SubType), mMessage(rMessage)
 	{
 	}
 	
 	${class}Exception(const ${class}Exception &rToCopy)
-		: mSubType(rToCopy.mSubType)
+	: mSubType(rToCopy.mSubType), mMessage(rToCopy.mMessage)
 	{
 	}
 	
@@ -108,9 +109,14 @@
 	virtual unsigned int GetType() const throw();
 	virtual unsigned int GetSubType() const throw();
 	virtual const char *what() const throw();
+	virtual const std::string& GetMessage() const
+	{
+		return mMessage;
+	}
 
 private:
 	unsigned int mSubType;
+	std::string mMessage;
 };
 
 #endif // $guardname




More information about the Boxbackup-commit mailing list