// SystemError.hpp #if !defined(SYSTEM_ERROR_HPP) #define SYSTEM_ERROR_HPP #include #include namespace CipresJNI { // SystemError class SystemError : public std::runtime_error { public: SystemError(const char *who, const char *message, int code) throw(); virtual ~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 CipresJNI #endif // SYSTEM_ERROR_HPP