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_stress.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'test/test_p2p_stress.cpp') diff --git a/test/test_p2p_stress.cpp b/test/test_p2p_stress.cpp index 3a71660..92e5bb4 100644 --- a/test/test_p2p_stress.cpp +++ b/test/test_p2p_stress.cpp @@ -114,9 +114,13 @@ void install_proto(AppContext &app, const size_t &seg_buff_size) { } } }); - net.reg_error_handler([ec](const std::exception &err, bool fatal) { - SALTICIDAE_LOG_WARN("main thread captured %s error: %s", - fatal ? "fatal" : "recoverable", err.what()); + net.reg_error_handler([ec](const std::exception_ptr _err, bool fatal) { + try { + std::rethrow_exception(_err); + } catch (const std::exception & err) { + SALTICIDAE_LOG_WARN("main thread captured %s error: %s", + fatal ? "fatal" : "recoverable", err.what()); + } }); net.reg_handler([&](MsgRand &&msg, const MyNet::conn_t &conn) { uint256_t hash = salticidae::get_hash(msg.bytes); -- cgit v1.2.3