From 33ab54c4a80f56ce291684bb1bf06ccb4aa7cb9d Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Fri, 15 Sep 2023 22:25:07 +1000 Subject: [PATCH] Add exceptions when sending fails --- tests/dsl/UDP.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/dsl/UDP.cpp b/tests/dsl/UDP.cpp index b09248391..35a373c3e 100644 --- a/tests/dsl/UDP.cpp +++ b/tests/dsl/UDP.cpp @@ -256,11 +256,16 @@ class TestReactor : public test_util::TestBase { auto send_all = [this](const std::string& type, const in_port_t& port) { for (const auto& t : send_targets(type, port)) { events.push_back(" -> " + t.to.address + ":" + std::to_string(t.to.port)); + try { emit(std::make_unique(t.data), t.to.address, t.to.port, t.from.address, t.from.port); + } + catch (std::exception& e) { + events.push_back("Exception: " + std::string(e.what())); + } } };