diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2014-01-20 19:40:52 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2014-01-20 19:40:52 +0000 |
commit | cc650e692e3e1201092d99a34a04e3af11ee2347 (patch) | |
tree | cb9fb079fe0783ad1f740cdba3e2ee4e9f79d53a /Lib/d/director.swg | |
parent | af6bee1e8c39eb80ad54a021380f2af32902f99b (diff) | |
download | swig-cc650e692e3e1201092d99a34a04e3af11ee2347.tar.gz |
Director exceptions now derive from std::exception
Diffstat (limited to 'Lib/d/director.swg')
-rw-r--r-- | Lib/d/director.swg | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Lib/d/director.swg b/Lib/d/director.swg index 6b6537103..a7d9c7688 100644 --- a/Lib/d/director.swg +++ b/Lib/d/director.swg @@ -9,6 +9,7 @@ #include <iostream> #endif #include <string> +#include <exception> namespace Swig { @@ -17,28 +18,25 @@ namespace Swig { }; // Base class for director exceptions. - class DirectorException { + class DirectorException : public std::exception { protected: std::string swig_msg; public: - DirectorException(const char *msg) : swig_msg(msg) { - } - DirectorException(const std::string &msg) : swig_msg(msg) { } - const std::string& what() const { - return swig_msg; + virtual ~DirectorException() throw() { } - virtual ~DirectorException() { + const char *what() const throw() { + return swig_msg.c_str(); } }; // Exception which is thrown when attempting to call a pure virtual method - // from D code thorugh the director layer. - class DirectorPureVirtualException : public Swig::DirectorException { + // from D code through the director layer. + class DirectorPureVirtualException : public DirectorException { public: DirectorPureVirtualException(const char *msg) : DirectorException(std::string("Attempted to invoke pure virtual method ") + msg) { } |