Skip to content

Commit 4127077

Browse files
committed
Unit tests: improve error messages when an exception happens
1 parent f3e1e97 commit 4127077

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

testing/int/tcpserver.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,16 @@ class tcp_server_wrapper {
3737
if (thread)
3838
thread->join();
3939
else
40-
srv_ctx->run();
40+
try {
41+
srv_ctx->run();
42+
} catch (std::exception &e) { INFO(e.what()); }
4143
}
4244
void run() {
43-
thread = std::make_unique<std::thread>([this](){ this->srv_ctx->run(); });
45+
thread = std::make_unique<std::thread>([this]() {
46+
try {
47+
this->srv_ctx->run();
48+
} catch (std::exception &e) { INFO(e.what()); }
49+
});
4450
}
4551
lsl::tcp_server* operator->() { return srv.get(); }
4652

0 commit comments

Comments
 (0)