From a9005311f51a250db26c966ce5fd4a7ba7d76fab Mon Sep 17 00:00:00 2001 From: Determinant Date: Fri, 14 Jun 2019 17:08:33 -0400 Subject: minor API change --- test/test_p2p.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'test/test_p2p.cpp') 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()); -- cgit v1.2.3