/* */ #ifndef _D_RECOVERABLE_EXCEPTION_H_ #define _D_RECOVERABLE_EXCEPTION_H_ #include "Exception.h" #include "DownloadResultCode.h" namespace aria2 { class RecoverableException:public Exception { private: downloadresultcode::RESULT _code; protected: virtual SharedHandle copy() const { SharedHandle e(new RecoverableException(*this)); return e; } public: RecoverableException(const char* file, int line, const std::string& msg): Exception(file, line, msg), _code(downloadresultcode::UNKNOWN_ERROR) {} RecoverableException(const char* file, int line, const std::string& msg, const Exception& cause): Exception(file, line, msg, cause), _code(downloadresultcode::UNKNOWN_ERROR) {} RecoverableException(const char* file, int line, const RecoverableException& e): Exception(file, line, e), _code(downloadresultcode::UNKNOWN_ERROR) {} RecoverableException(const char* file, int line, const std::string& msg, downloadresultcode::RESULT result): Exception(file, line, msg), _code(result) {} downloadresultcode::RESULT getCode() const { return _code; } }; } // namespace aria2 #endif // _D_RECOVERABLE_EXCEPTION_EX_H_