diff options
Diffstat (limited to 'src/2geom')
| -rw-r--r-- | src/2geom/exception.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/2geom/exception.h b/src/2geom/exception.h index bd950726f..1a031cab9 100644 --- a/src/2geom/exception.h +++ b/src/2geom/exception.h @@ -31,6 +31,7 @@ */ #include <exception> +#include <sstream> #include <string> namespace Geom { @@ -39,19 +40,15 @@ namespace Geom { class Exception : public std::exception { public: Exception(const char * message, const char *file, const int line) - : msgstr("Exception thrown: ") { - msgstr += message; - msgstr += " ("; - msgstr += file; - msgstr += ":"; - msgstr += line; - msgstr += ")"; + std::ostringstream os; + os << "lib2geom exception: " << message << " (" << file << ":" << line << ")"; + msgstr = os.str(); } virtual ~Exception() throw() {} // necessary to destroy the string object!!! - virtual const char * what() const throw (){ + virtual const char* what() const throw (){ return msgstr.c_str(); } protected: |
