mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-31 19:33:34 +00:00
Codechange: Don't use NOT_REACHED() when catching unhandled thread exceptions (#12199)
This commit is contained in:
parent
a602845d0a
commit
b53d79b1d2
@ -12,6 +12,7 @@
|
||||
|
||||
#include "debug.h"
|
||||
#include "crashlog.h"
|
||||
#include "error_func.h"
|
||||
#include <system_error>
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
@ -62,6 +63,8 @@ inline bool StartNewThread(std::thread *thr, const char *name, TFn&& _Fx, TArgs&
|
||||
try {
|
||||
/* Call user function with the given arguments. */
|
||||
F(A...);
|
||||
} catch (std::exception &e) {
|
||||
FatalError("Unhandled exception in {} thread: {}", name, e.what());
|
||||
} catch (...) {
|
||||
NOT_REACHED();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user