COIN-OR::LEMON - Graph Library

Changeset 2151:38ec4a930c05 in lemon-0.x for lemon/error.h


Ignore:
Timestamp:
07/18/06 15:29:59 (18 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2865
Message:

exceptionName() has been thrown away

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/error.h

    r2150 r2151  
    177177    ///\e
    178178    virtual ~Exception() throw() {}
    179 
    180     ///\e
    181     virtual const char* exceptionName() const {
     179    ///\e
     180    virtual const char* what() const throw() {
    182181      return "lemon::Exception";
    183     }
    184    
    185     ///\e
    186     virtual const char* what() const throw() {
    187       return exceptionName();
    188182    }
    189183  };
     
    200194  class LogicError : public Exception {
    201195  public:
    202     virtual const char* exceptionName() const {
     196    virtual const char* what() const throw() {
    203197      return "lemon::LogicError";
    204198    }
     
    213207  class UninitializedParameter : public LogicError {
    214208  public:
    215     virtual const char* exceptionName() const {
     209    virtual const char* what() const throw() {
    216210      return "lemon::UninitializedParameter";
    217211    }
     
    228222  class RuntimeError : public Exception {
    229223  public:
    230     virtual const char* exceptionName() const {
     224    virtual const char* what() const throw() {
    231225      return "lemon::RuntimeError";
    232226    }
     
    236230  class RangeError : public RuntimeError {
    237231  public:
    238     virtual const char* exceptionName() const {
     232    virtual const char* what() const throw() {
    239233      return "lemon::RangeError";
    240234    }
     
    244238  class IOError : public RuntimeError {
    245239  public:
    246     virtual const char* exceptionName() const {
     240    virtual const char* what() const throw() {
    247241      return "lemon::IOError";
    248242    }
     
    305299      try {
    306300        std::ostringstream ostr;
    307         ostr << exceptionName() << ": ";
     301        ostr << "lemon:DataFormatError" << ": ";
    308302        if (message()) ostr << message();
    309303        if( file() || line() != 0 ) {
     
    318312      catch (...) {}
    319313      if( _message_holder.valid()) return _message_holder.get().c_str();
    320       return exceptionName();
    321     }
    322 
    323     virtual const char* exceptionName() const {
    324       return "lemon::DataFormatError";
     314      return "lemon:DataFormatError";
    325315    }
    326316
     
    362352      try {
    363353        std::ostringstream ostr;
    364         ostr << exceptionName() << ": ";
     354        ostr << "lemon::FileOpenError" << ": ";
    365355        ostr << "Cannot open file - " << file();
    366356        _message_holder.set(ostr.str());
     
    368358      catch (...) {}
    369359      if( _message_holder.valid()) return _message_holder.get().c_str();
    370       return exceptionName();
    371     }
    372 
    373     virtual const char* exceptionName() const {
    374360      return "lemon::FileOpenError";
    375361    }
    376 
    377362    virtual ~FileOpenError() throw() {}
    378363  };
     
    432417      catch (...) {}
    433418      if( _message_holder.valid() ) return _message_holder.get().c_str();
    434       return exceptionName();
    435     }
    436 
    437     virtual const char* exceptionName() const {
    438       return "lemon::IOParameterError";
    439     }
    440 
     419      return "lemon:IOParameterError";
     420    }
    441421    virtual ~IOParameterError() throw() {}
    442422  };
     
    486466      catch(...) {}
    487467      if( _message_holder.valid() ) return _message_holder.get().c_str();
    488       return exceptionName();
    489     }
    490 
    491     virtual const char* exceptionName() const {
    492468      return "lemon::AssertionFailedError";
    493469    }
    494 
    495     virtual ~AssertionFailedError() throw() {}
     470   virtual ~AssertionFailedError() throw() {}
    496471  };
    497472
Note: See TracChangeset for help on using the changeset viewer.