diff options
Diffstat (limited to 'src/anytun.cpp')
-rw-r--r-- | src/anytun.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/anytun.cpp b/src/anytun.cpp index 3d985d4..ed6d845 100644 --- a/src/anytun.cpp +++ b/src/anytun.cpp @@ -191,6 +191,10 @@ void* sender(void* p) } } } + catch(std::runtime_error e) + { + cLog.msg(Log::PRIO_ERR) << "sender thread died due to an uncaught runtime_error: " << e.what(); + } catch(std::exception e) { cLog.msg(Log::PRIO_ERR) << "sender thread died due to an uncaught exception: " << e.what(); @@ -323,6 +327,10 @@ void* receiver(void* p) param->dev.write(plain_packet.getPayload(), plain_packet.getLength()); } } + catch(std::runtime_error e) + { + cLog.msg(Log::PRIO_ERR) << "sender thread died due to an uncaught runtime_error: " << e.what(); + } catch(std::exception e) { cLog.msg(Log::PRIO_ERR) << "receiver thread died due to an uncaught exception: " << e.what(); @@ -567,6 +575,13 @@ int main(int argc, char* argv[]) return ret; } + catch(std::runtime_error e) + { + if(daemonized) + cLog.msg(Log::PRIO_ERR) << "uncaught runtime error, exiting: " << e.what(); + else + std::cout << "uncaught runtime error, exiting: " << e.what() << std::endl; + } catch(std::exception e) { if(daemonized) |