--- trunk/src/utils/OpenMDException.hpp 2009/11/25 20:02:06 1390 +++ trunk/src/utils/OpenMDException.hpp 2014/11/28 20:10:17 2045 @@ -35,24 +35,33 @@ * * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). - * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). - * [4] Vardeman & Gezelter, in progress (2009). + * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). + * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). + * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ #ifndef UTILS_OPENMDEXCEPTION_HPP #define UTILS_OPENMDEXCEPTION_HPP -namespace OpenMD { -class OpenMDException { - public: - OpenMDException() : msg_("") {} - OpenMDException(const std::string msg) : msg_(msg) {} - const std::string getMessage() {return msg_;} - private: +#include - std::string msg_; +namespace OpenMD { -}; + class OpenMDException : public std::exception { + public: + OpenMDException() : msg_("") {} + explicit OpenMDException(const std::string &msg) : msg_(msg) {}; + ~OpenMDException() throw() {} + + const char * what () const throw () + { + return msg_.c_str(); + } + private: + std::string msg_; + + }; + } #endif