From 75bee9463db9fc3782562f6f1e45310de0cca5cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Mon, 7 Oct 2024 22:18:11 +0200 Subject: [PATCH] Log test system exceptions (#4746) --- nano/test_common/system.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/nano/test_common/system.cpp b/nano/test_common/system.cpp index c89eb8809..c0a9831cf 100644 --- a/nano/test_common/system.cpp +++ b/nano/test_common/system.cpp @@ -351,7 +351,20 @@ std::error_code nano::test::system::poll_until_true (std::chrono::nanoseconds de deadline_set (deadline_a); while (!ec && !predicate_a ()) { - ec = poll (); + try + { + ec = poll (); + } + catch (std::exception const & ex) + { + std::cerr << "Error running IO: " << ex.what () << std::endl; + ec = nano::error_system::generic; + } + catch (...) + { + std::cerr << "Unknown error running IO" << std::endl; + ec = nano::error_system::generic; + } } return ec; }