diff -r cce8ac91c08c -r 38ec4a930c05 lemon/error.h --- a/lemon/error.h Tue Jul 18 12:10:52 2006 +0000 +++ b/lemon/error.h Tue Jul 18 13:29:59 2006 +0000 @@ -176,15 +176,9 @@ Exception() {} ///\e virtual ~Exception() throw() {} - - ///\e - virtual const char* exceptionName() const { - return "lemon::Exception"; - } - ///\e virtual const char* what() const throw() { - return exceptionName(); + return "lemon::Exception"; } }; @@ -199,7 +193,7 @@ */ class LogicError : public Exception { public: - virtual const char* exceptionName() const { + virtual const char* what() const throw() { return "lemon::LogicError"; } }; @@ -212,7 +206,7 @@ */ class UninitializedParameter : public LogicError { public: - virtual const char* exceptionName() const { + virtual const char* what() const throw() { return "lemon::UninitializedParameter"; } }; @@ -227,7 +221,7 @@ */ class RuntimeError : public Exception { public: - virtual const char* exceptionName() const { + virtual const char* what() const throw() { return "lemon::RuntimeError"; } }; @@ -235,7 +229,7 @@ ///\e class RangeError : public RuntimeError { public: - virtual const char* exceptionName() const { + virtual const char* what() const throw() { return "lemon::RangeError"; } }; @@ -243,7 +237,7 @@ ///\e class IOError : public RuntimeError { public: - virtual const char* exceptionName() const { + virtual const char* what() const throw() { return "lemon::IOError"; } }; @@ -304,7 +298,7 @@ virtual const char* what() const throw() { try { std::ostringstream ostr; - ostr << exceptionName() << ": "; + ostr << "lemon:DataFormatError" << ": "; if (message()) ostr << message(); if( file() || line() != 0 ) { ostr << " ("; @@ -317,11 +311,7 @@ } catch (...) {} if( _message_holder.valid()) return _message_holder.get().c_str(); - return exceptionName(); - } - - virtual const char* exceptionName() const { - return "lemon::DataFormatError"; + return "lemon:DataFormatError"; } virtual ~DataFormatError() throw() {} @@ -361,19 +351,14 @@ virtual const char* what() const throw() { try { std::ostringstream ostr; - ostr << exceptionName() << ": "; + ostr << "lemon::FileOpenError" << ": "; ostr << "Cannot open file - " << file(); _message_holder.set(ostr.str()); } catch (...) {} if( _message_holder.valid()) return _message_holder.get().c_str(); - return exceptionName(); - } - - virtual const char* exceptionName() const { return "lemon::FileOpenError"; } - virtual ~FileOpenError() throw() {} }; @@ -431,13 +416,8 @@ } catch (...) {} if( _message_holder.valid() ) return _message_holder.get().c_str(); - return exceptionName(); + return "lemon:IOParameterError"; } - - virtual const char* exceptionName() const { - return "lemon::IOParameterError"; - } - virtual ~IOParameterError() throw() {} }; @@ -485,14 +465,9 @@ } catch(...) {} if( _message_holder.valid() ) return _message_holder.get().c_str(); - return exceptionName(); - } - - virtual const char* exceptionName() const { return "lemon::AssertionFailedError"; } - - virtual ~AssertionFailedError() throw() {} + virtual ~AssertionFailedError() throw() {} };