summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2008-12-05 20:32:50 +0000
committerChris Wilson <chris+github@qwirx.com>2008-12-05 20:32:50 +0000
commitd0080cc1af9aa2fd6488ddb3f9f24e6c89239dc0 (patch)
tree8e5c2f46fb2150af8b8d2d6f4778b2733ef78632 /lib
parent8d0095dea055c919103a7aabfc3a1b85af1feb0e (diff)
Allow exceptions to contain a message string.
Diffstat (limited to 'lib')
-rwxr-xr-xlib/common/makeexception.pl.in12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/common/makeexception.pl.in b/lib/common/makeexception.pl.in
index 1564b75b..76b9b02b 100755
--- a/lib/common/makeexception.pl.in
+++ b/lib/common/makeexception.pl.in
@@ -71,13 +71,14 @@ print H <<__E;
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 @@ print H <<__E;
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