summaryrefslogtreecommitdiff
path: root/src/NameMatchOptionHandler.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-04-27 02:22:14 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-04-27 02:22:14 +0000
commit1ef99931e131343f069a4b74edfc06196d72d85b (patch)
treed640f061a66a193d5f4d92b61836161208ccff14 /src/NameMatchOptionHandler.h
parenta7952cce05a41c6e20d6eddc569a8bffe974aade (diff)
2008-04-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Rewritten Exception class. Throw exception object, not its pointer and catch by reference, so that remove problematic delete operator for catched exception. * src/Exception.cc * src/Exception.h * test/ExceptionTest.cc * src/*: All files throwing/catching exception. * test/*: All files throwing/catching exception.
Diffstat (limited to 'src/NameMatchOptionHandler.h')
-rw-r--r--src/NameMatchOptionHandler.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/NameMatchOptionHandler.h b/src/NameMatchOptionHandler.h
index d8c0e099..12374a82 100644
--- a/src/NameMatchOptionHandler.h
+++ b/src/NameMatchOptionHandler.h
@@ -37,6 +37,7 @@
#include "OptionHandler.h"
#include "DlAbortEx.h"
+#include "StringFormat.h"
#include <strings.h>
namespace aria2 {
@@ -62,8 +63,10 @@ public:
{
try {
parseArg(option, arg);
- } catch(Exception* e) {
- throw new DlAbortEx(e, "Exception occurred while processing option %s", _optName.c_str());
+ } catch(Exception& e) {
+ throw DlAbortEx
+ (StringFormat("Exception occurred while processing option %s",
+ _optName.c_str()).str(), e);
}
}
};