/* */ #ifndef D_EXCEPTION_H #define D_EXCEPTION_H #include "common.h" #include #include #include "SharedHandle.h" namespace aria2 { class Exception:public std::exception { private: const char* file_; int line_; int errno_; std::string msg_; SharedHandle cause_; protected: virtual SharedHandle copy() const = 0; public: explicit Exception(const char* file, int line, const std::string& msg); Exception(const char* file, int line, const std::string& msg, const Exception& cause); Exception(const char* file, int line, const Exception& e); Exception(const char* file, int line, int errnoArg, const std::string& msg); virtual ~Exception() throw(); virtual const char* what() const throw(); std::string stackTrace() const; int getErrno() const { return errno_; } }; } // namespace aria2 #endif // D_EXCEPTION_H