mirror of https://github.com/aria2/aria2
Cleaned up Exception constructors.
Removed Exception(const char*, int, const Exception&) ctor. Also removed FatalException() copy ctor.pull/1/head
parent
50122f0ab3
commit
45fde1adaf
|
@ -49,12 +49,9 @@ DlAbortEx::DlAbortEx(const char* file, int line, const std::string& msg,
|
||||||
const Exception& cause):
|
const Exception& cause):
|
||||||
RecoverableException(file, line, msg, cause) {}
|
RecoverableException(file, line, msg, cause) {}
|
||||||
|
|
||||||
DlAbortEx::DlAbortEx(const char* file, int line, const RecoverableException& e):
|
|
||||||
RecoverableException(file, line, e) {}
|
|
||||||
|
|
||||||
DlAbortEx::DlAbortEx
|
DlAbortEx::DlAbortEx
|
||||||
(const char* file, int line, int errnoArg, const std::string& msg):
|
(const char* file, int line, int errNum, const std::string& msg):
|
||||||
RecoverableException(file, line, errnoArg, msg) {}
|
RecoverableException(file, line, errNum, msg) {}
|
||||||
|
|
||||||
DlAbortEx::DlAbortEx(const char* file, int line, const std::string& msg,
|
DlAbortEx::DlAbortEx(const char* file, int line, const std::string& msg,
|
||||||
error_code::Value code):
|
error_code::Value code):
|
||||||
|
|
|
@ -47,9 +47,7 @@ public:
|
||||||
DlAbortEx(const char* file, int line, const std::string& msg,
|
DlAbortEx(const char* file, int line, const std::string& msg,
|
||||||
const Exception& cause);
|
const Exception& cause);
|
||||||
|
|
||||||
DlAbortEx(const char* file, int line, const RecoverableException& e);
|
DlAbortEx(const char* file, int line, int errNum, const std::string& msg);
|
||||||
|
|
||||||
DlAbortEx(const char* file, int line, int errnoArg, const std::string& msg);
|
|
||||||
|
|
||||||
DlAbortEx(const char* file, int line, const std::string& msg,
|
DlAbortEx(const char* file, int line, const std::string& msg,
|
||||||
error_code::Value code);
|
error_code::Value code);
|
||||||
|
|
|
@ -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,
|
DlRetryEx::DlRetryEx(const char* file, int line, const std::string& msg,
|
||||||
const Exception& cause):
|
const Exception& cause):
|
||||||
RecoverableException(file, line, msg, 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,
|
DlRetryEx::DlRetryEx(const char* file, int line, const std::string& msg,
|
||||||
error_code::Value code):
|
error_code::Value code):
|
||||||
RecoverableException(file, line, msg, code) {}
|
RecoverableException(file, line, msg, code) {}
|
||||||
|
|
|
@ -47,8 +47,6 @@ public:
|
||||||
DlRetryEx(const char* file, int line, const std::string& msg,
|
DlRetryEx(const char* file, int line, const std::string& msg,
|
||||||
const Exception& cause);
|
const Exception& cause);
|
||||||
|
|
||||||
DlRetryEx(const char* file, int line, const DlRetryEx& e);
|
|
||||||
|
|
||||||
DlRetryEx(const char* file, int line, const std::string& msg,
|
DlRetryEx(const char* file, int line, const std::string& msg,
|
||||||
error_code::Value code);
|
error_code::Value code);
|
||||||
};
|
};
|
||||||
|
|
|
@ -51,11 +51,6 @@ DownloadFailureException::DownloadFailureException
|
||||||
const Exception& cause):
|
const Exception& cause):
|
||||||
RecoverableException(file, line, msg, cause) {}
|
RecoverableException(file, line, msg, cause) {}
|
||||||
|
|
||||||
DownloadFailureException::DownloadFailureException
|
|
||||||
(const char* file, int line,
|
|
||||||
const DownloadFailureException& e):
|
|
||||||
RecoverableException(file, line, e) {}
|
|
||||||
|
|
||||||
DownloadFailureException::DownloadFailureException
|
DownloadFailureException::DownloadFailureException
|
||||||
(const char* file, int line,
|
(const char* file, int line,
|
||||||
const std::string& msg,
|
const std::string& msg,
|
||||||
|
|
|
@ -51,9 +51,6 @@ public:
|
||||||
DownloadFailureException(const char* file, int line, const std::string& msg,
|
DownloadFailureException(const char* file, int line, const std::string& msg,
|
||||||
const Exception& cause);
|
const Exception& cause);
|
||||||
|
|
||||||
DownloadFailureException(const char* file, int line,
|
|
||||||
const DownloadFailureException& e);
|
|
||||||
|
|
||||||
DownloadFailureException(const char* file, int line,
|
DownloadFailureException(const char* file, int line,
|
||||||
const std::string& msg,
|
const std::string& msg,
|
||||||
error_code::Value code);
|
error_code::Value code);
|
||||||
|
|
|
@ -60,17 +60,6 @@ Exception::Exception
|
||||||
cause_(cause.copy())
|
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
|
Exception::Exception
|
||||||
(const char* file,
|
(const char* file,
|
||||||
int line,
|
int line,
|
||||||
|
|
|
@ -59,13 +59,11 @@ protected:
|
||||||
virtual SharedHandle<Exception> copy() const = 0;
|
virtual SharedHandle<Exception> copy() const = 0;
|
||||||
|
|
||||||
public:
|
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,
|
Exception(const char* file, int line, const std::string& msg,
|
||||||
const Exception& cause);
|
const Exception& cause);
|
||||||
|
|
||||||
Exception(const char* file, int line, const Exception& e);
|
|
||||||
|
|
||||||
Exception(const char* file, int line, int errNum, const std::string& msg);
|
Exception(const char* file, int line, int errNum, const std::string& msg);
|
||||||
|
|
||||||
virtual ~Exception() throw();
|
virtual ~Exception() throw();
|
||||||
|
|
|
@ -51,6 +51,4 @@ FatalException::FatalException
|
||||||
const Exception& cause):
|
const Exception& cause):
|
||||||
Exception(file, line, msg, cause) {}
|
Exception(file, line, msg, cause) {}
|
||||||
|
|
||||||
FatalException::FatalException(const FatalException& e):Exception(e) {}
|
|
||||||
|
|
||||||
} // namespace aria2
|
} // namespace aria2
|
||||||
|
|
|
@ -46,8 +46,6 @@ public:
|
||||||
|
|
||||||
FatalException(const char* file, int line, const std::string& msg,
|
FatalException(const char* file, int line, const std::string& msg,
|
||||||
const Exception& cause);
|
const Exception& cause);
|
||||||
|
|
||||||
FatalException(const FatalException& e);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define FATAL_EXCEPTION(arg) \
|
#define FATAL_EXCEPTION(arg) \
|
||||||
|
|
|
@ -53,10 +53,6 @@ OptionHandlerException::OptionHandlerException(const char* file, int line,
|
||||||
(file, line, fmt(MESSAGE.c_str(), optName.c_str()), cause),
|
(file, line, fmt(MESSAGE.c_str(), optName.c_str()), cause),
|
||||||
optName_(optName) {}
|
optName_(optName) {}
|
||||||
|
|
||||||
OptionHandlerException::OptionHandlerException(const char* file, int line,
|
|
||||||
const OptionHandlerException& e):
|
|
||||||
RecoverableException(file, line, e), optName_(e.optName_) {}
|
|
||||||
|
|
||||||
OptionHandlerException::~OptionHandlerException() throw() {}
|
OptionHandlerException::~OptionHandlerException() throw() {}
|
||||||
|
|
||||||
const std::string& OptionHandlerException::getOptionName() const throw()
|
const std::string& OptionHandlerException::getOptionName() const throw()
|
||||||
|
|
|
@ -52,9 +52,6 @@ public:
|
||||||
OptionHandlerException(const char* file, int line, const std::string& optName,
|
OptionHandlerException(const char* file, int line, const std::string& optName,
|
||||||
const Exception& cause);
|
const Exception& cause);
|
||||||
|
|
||||||
OptionHandlerException(const char* file, int line,
|
|
||||||
const OptionHandlerException& e);
|
|
||||||
|
|
||||||
virtual ~OptionHandlerException() throw();
|
virtual ~OptionHandlerException() throw();
|
||||||
|
|
||||||
const std::string& getOptionName() const throw();
|
const std::string& getOptionName() const throw();
|
||||||
|
|
|
@ -54,14 +54,8 @@ RecoverableException::RecoverableException
|
||||||
code_(error_code::UNKNOWN_ERROR) {}
|
code_(error_code::UNKNOWN_ERROR) {}
|
||||||
|
|
||||||
RecoverableException::RecoverableException
|
RecoverableException::RecoverableException
|
||||||
(const char* file, int line,
|
(const char* file, int line, int errNum, const std::string& msg):
|
||||||
const RecoverableException& e):
|
Exception(file, line, errNum, msg),
|
||||||
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),
|
|
||||||
code_(error_code::UNKNOWN_ERROR) {}
|
code_(error_code::UNKNOWN_ERROR) {}
|
||||||
|
|
||||||
RecoverableException::RecoverableException
|
RecoverableException::RecoverableException
|
||||||
|
|
|
@ -51,11 +51,8 @@ public:
|
||||||
RecoverableException(const char* file, int line, const std::string& msg,
|
RecoverableException(const char* file, int line, const std::string& msg,
|
||||||
const Exception& cause);
|
const Exception& cause);
|
||||||
|
|
||||||
RecoverableException(const char* file, int line,
|
|
||||||
const RecoverableException& e);
|
|
||||||
|
|
||||||
RecoverableException
|
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,
|
RecoverableException(const char* file, int line, const std::string& msg,
|
||||||
error_code::Value result);
|
error_code::Value result);
|
||||||
|
|
Loading…
Reference in New Issue