summaryrefslogtreecommitdiff
path: root/src/DHTRoutingTableSerializer.cc
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/DHTRoutingTableSerializer.cc
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/DHTRoutingTableSerializer.cc')
-rw-r--r--src/DHTRoutingTableSerializer.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/DHTRoutingTableSerializer.cc b/src/DHTRoutingTableSerializer.cc
index 65d9f16a..00f74434 100644
--- a/src/DHTRoutingTableSerializer.cc
+++ b/src/DHTRoutingTableSerializer.cc
@@ -39,6 +39,7 @@
#include "PeerMessageUtil.h"
#include "Logger.h"
#include "a2netcompat.h"
+#include "StringFormat.h"
#include <cerrno>
#include <cstring>
#include <ostream>
@@ -121,8 +122,9 @@ void DHTRoutingTableSerializer::serialize(std::ostream& o)
o.write(zero, 4);
}
} catch(std::ios::failure const& exception) {
- throw new DlAbortEx("Failed to save DHT routing table. cause:%s",
- strerror(errno));
+ throw DlAbortEx
+ (StringFormat("Failed to save DHT routing table. cause:%s",
+ strerror(errno)).str());
}
}