// SystemError.hpp #if !defined(SYSTEM_ERROR_HPP) #define SYSTEM_ERROR_HPP #include #include namespace Cipres { // SystemError class SystemError : public std::runtime_error { public: SystemError(const std::string &who, const std::string &message, int code) throw(); ~SystemError() throw() { } // code int code() const throw() { return m_error_code; } // what const char *what() const throw() { if(!m_error_message.empty()) return m_error_message.c_str(); else return runtime_error::what(); } private: const int m_error_code; std::string m_error_message; }; } // namespace Cipres #endif // SYSTEM_ERROR_HPP