Cleaned up Exception constructors.

Removed Exception(const char*, int, const Exception&) ctor.  Also
removed FatalException() copy ctor.
pull/1/head
Tatsuhiro Tsujikawa 2010-11-28 21:03:11 +09:00
parent 50122f0ab3
commit 45fde1adaf
14 changed files with 8 additions and 57 deletions

View File

@ -49,12 +49,9 @@ DlAbortEx::DlAbortEx(const char* file, int line, const std::string& msg,
const Exception& cause):
RecoverableException(file, line, msg, cause) {}
DlAbortEx::DlAbortEx(const char* file, int line, const RecoverableException& e):
RecoverableException(file, line, e) {}
DlAbortEx::DlAbortEx
(const char* file, int line, int errnoArg, const std::string& msg):
RecoverableException(file, line, errnoArg, msg) {}
(const char* file, int line, int errNum, const std::string& msg):
RecoverableException(file, line, errNum, msg) {}
DlAbortEx::DlAbortEx(const char* file, int line, const std::string& msg,
error_code::Value code):

View File

@ -47,9 +47,7 @@ public:
DlAbortEx(const char* file, int line, const std::string& msg,
const Exception& cause);
DlAbortEx(const char* file, int line, const RecoverableException& e);
DlAbortEx(const char* file, int line, int errnoArg, const std::string& msg);
DlAbortEx(const char* file, int line, int errNum, const std::string& msg);
DlAbortEx(const char* file, int line, const std::string& msg,
error_code::Value code);

View File

@ -48,8 +48,7 @@ DlRetryEx::DlRetryEx(const char* file, int line, const std::string& msg):
DlRetryEx::DlRetryEx(const char* file, int line, const std::string& msg,
const Exception& cause):
RecoverableException(file, line, msg, cause) {}
DlRetryEx::DlRetryEx(const char* file, int line, const DlRetryEx& e):
RecoverableException(file, line, e) {}
DlRetryEx::DlRetryEx(const char* file, int line, const std::string& msg,
error_code::Value code):
RecoverableException(file, line, msg, code) {}

View File

@ -47,8 +47,6 @@ public:
DlRetryEx(const char* file, int line, const std::string& msg,
const Exception& cause);
DlRetryEx(const char* file, int line, const DlRetryEx& e);
DlRetryEx(const char* file, int line, const std::string& msg,
error_code::Value code);
};

View File

@ -51,11 +51,6 @@ DownloadFailureException::DownloadFailureException
const Exception& cause):
RecoverableException(file, line, msg, cause) {}
DownloadFailureException::DownloadFailureException
(const char* file, int line,
const DownloadFailureException& e):
RecoverableException(file, line, e) {}
DownloadFailureException::DownloadFailureException
(const char* file, int line,
const std::string& msg,

View File

@ -51,9 +51,6 @@ public:
DownloadFailureException(const char* file, int line, const std::string& msg,
const Exception& cause);
DownloadFailureException(const char* file, int line,
const DownloadFailureException& e);
DownloadFailureException(const char* file, int line,
const std::string& msg,
error_code::Value code);

View File

@ -60,17 +60,6 @@ Exception::Exception
cause_(cause.copy())
{}
Exception::Exception
(const char* file,
int line,
const Exception& e)
: file_(file),
line_(line),
errNum_(0),
msg_(e.msg_),
cause_(e.cause_)
{}
Exception::Exception
(const char* file,
int line,

View File

@ -59,13 +59,11 @@ protected:
virtual SharedHandle<Exception> 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);
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 errNum, const std::string& msg);
virtual ~Exception() throw();

View File

@ -51,6 +51,4 @@ FatalException::FatalException
const Exception& cause):
Exception(file, line, msg, cause) {}
FatalException::FatalException(const FatalException& e):Exception(e) {}
} // namespace aria2

View File

@ -46,8 +46,6 @@ public:
FatalException(const char* file, int line, const std::string& msg,
const Exception& cause);
FatalException(const FatalException& e);
};
#define FATAL_EXCEPTION(arg) \

View File

@ -53,10 +53,6 @@ OptionHandlerException::OptionHandlerException(const char* file, int line,
(file, line, fmt(MESSAGE.c_str(), optName.c_str()), cause),
optName_(optName) {}
OptionHandlerException::OptionHandlerException(const char* file, int line,
const OptionHandlerException& e):
RecoverableException(file, line, e), optName_(e.optName_) {}
OptionHandlerException::~OptionHandlerException() throw() {}
const std::string& OptionHandlerException::getOptionName() const throw()

View File

@ -52,9 +52,6 @@ public:
OptionHandlerException(const char* file, int line, const std::string& optName,
const Exception& cause);
OptionHandlerException(const char* file, int line,
const OptionHandlerException& e);
virtual ~OptionHandlerException() throw();
const std::string& getOptionName() const throw();

View File

@ -54,14 +54,8 @@ RecoverableException::RecoverableException
code_(error_code::UNKNOWN_ERROR) {}
RecoverableException::RecoverableException
(const char* file, int line,
const RecoverableException& e):
Exception(file, line, e),
code_(error_code::UNKNOWN_ERROR) {}
RecoverableException::RecoverableException
(const char* file, int line, int errnoArg, const std::string& msg):
Exception(file, line, errnoArg, msg),
(const char* file, int line, int errNum, const std::string& msg):
Exception(file, line, errNum, msg),
code_(error_code::UNKNOWN_ERROR) {}
RecoverableException::RecoverableException

View File

@ -51,11 +51,8 @@ public:
RecoverableException(const char* file, int line, const std::string& msg,
const Exception& cause);
RecoverableException(const char* file, int line,
const RecoverableException& e);
RecoverableException
(const char* file, int line, int errnoArg, const std::string& msg);
(const char* file, int line, int errNum, const std::string& msg);
RecoverableException(const char* file, int line, const std::string& msg,
error_code::Value result);