[ox/logconn] Add exception handling for logger thread
All checks were successful
Build / build (push) Successful in 1m18s
All checks were successful
Build / build (push) Successful in 1m18s
This commit is contained in:
5
deps/ox/src/ox/logconn/logconn.cpp
vendored
5
deps/ox/src/ox/logconn/logconn.cpp
vendored
@ -91,6 +91,7 @@ ox::Error LoggerConn::sendInit(const InitTraceMsg &msg) noexcept {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LoggerConn::msgSend() noexcept {
|
void LoggerConn::msgSend() noexcept {
|
||||||
|
try {
|
||||||
while (true) {
|
while (true) {
|
||||||
std::unique_lock lk(m_waitMut);
|
std::unique_lock lk(m_waitMut);
|
||||||
m_waitCond.wait(lk);
|
m_waitCond.wait(lk);
|
||||||
@ -109,6 +110,10 @@ void LoggerConn::msgSend() noexcept {
|
|||||||
std::ignore = send(tmp.data(), read);
|
std::ignore = send(tmp.data(), read);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (std::exception const &e) {
|
||||||
|
oxErrf("Exception in logger thread: {}\n", e.what());
|
||||||
|
oxAssert(false, "logger thread exception");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user