浏览代码

Cleaned up Exception constructors.

Removed Exception(const char*, int, const Exception&) ctor.  Also
removed FatalException() copy ctor.
Tatsuhiro Tsujikawa 15 年之前
父节点
当前提交
45fde1adaf

+ 2 - 5
src/DlAbortEx.cc

@@ -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):

+ 1 - 3
src/DlAbortEx.h

@@ -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);

+ 1 - 2
src/DlRetryEx.cc

@@ -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) {}

+ 0 - 2
src/DlRetryEx.h

@@ -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);
 };

+ 0 - 5
src/DownloadFailureException.cc

@@ -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,

+ 0 - 3
src/DownloadFailureException.h

@@ -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);

+ 0 - 11
src/Exception.cc

@@ -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,

+ 1 - 3
src/Exception.h

@@ -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();

+ 0 - 2
src/FatalException.cc

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

+ 0 - 2
src/FatalException.h

@@ -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)                    \

+ 0 - 4
src/OptionHandlerException.cc

@@ -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()

+ 0 - 3
src/OptionHandlerException.h

@@ -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();

+ 2 - 8
src/RecoverableException.cc

@@ -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

+ 1 - 4
src/RecoverableException.h

@@ -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);