diff options
author | Determinant <[email protected]> | 2019-06-12 19:14:40 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2019-06-12 19:14:40 -0400 |
commit | e27e529e589ef89fbe010ebf7c5635ec2873f64f (patch) | |
tree | 76e7d20589d11f3aabd255ca70201f1288d1d1bc /test/test_p2p_stress.cpp | |
parent | 9f6460c7ab774d900f391345bbf3fac8617a3aa3 (diff) |
WIP: error handling
Diffstat (limited to 'test/test_p2p_stress.cpp')
-rw-r--r-- | test/test_p2p_stress.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/test_p2p_stress.cpp b/test/test_p2p_stress.cpp index 70e3444..7321217 100644 --- a/test/test_p2p_stress.cpp +++ b/test/test_p2p_stress.cpp @@ -114,6 +114,11 @@ 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()); + ec.stop(); + }); net.reg_handler([&](MsgRand &&msg, const MyNet::conn_t &conn) { uint256_t hash = salticidae::get_hash(msg.bytes); net.send_msg(MsgAck(hash), conn); |