aboutsummaryrefslogtreecommitdiff
path: root/test/test_p2p.cpp
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-06-14 17:08:33 -0400
committerDeterminant <[email protected]>2019-06-14 17:08:33 -0400
commita9005311f51a250db26c966ce5fd4a7ba7d76fab (patch)
tree6a31f53fa4f6e4cd77ca0d403151c9c9645f3ed1 /test/test_p2p.cpp
parent6c927588f78c663fded354fd696997d09fb5d697 (diff)
minor API change
Diffstat (limited to 'test/test_p2p.cpp')
-rw-r--r--test/test_p2p.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/test_p2p.cpp b/test/test_p2p.cpp
index 6d311a6..14304eb 100644
--- a/test/test_p2p.cpp
+++ b/test/test_p2p.cpp
@@ -79,8 +79,13 @@ struct Net {
net->reg_handler([this](const MsgText &msg, const PeerNetwork::conn_t &) {
fprintf(stdout, "net %lu: peer %lu says %s\n", this->id, msg.id, msg.text.c_str());
});
- net->reg_error_handler([this](const std::exception &err, bool fatal) {
- fprintf(stdout, "net %lu: captured %s error during an async call: %s\n", this->id, fatal ? "fatal" : "recoverable", err.what());
+ net->reg_error_handler([this](const std::exception_ptr _err, bool fatal) {
+ try {
+ std::rethrow_exception(_err);
+ } catch (const std::exception &err) {
+ fprintf(stdout, "net %lu: captured %s error during an async call: %s\n",
+ this->id, fatal ? "fatal" : "recoverable", err.what());
+ }
});
net->reg_unknown_peer_handler([this](const NetAddr &addr) {
fprintf(stdout, "net %lu: unknown peer attempts to connnect %s\n", this->id, std::string(addr).c_str());