summaryrefslogtreecommitdiff
path: root/src/anytun.cpp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2008-05-13 19:42:57 +0000
committerChristian Pointner <equinox@anytun.org>2008-05-13 19:42:57 +0000
commit5ed2af680d89d8643530f5e9f26ccb832e6bad3e (patch)
treef857d9d74e00be8d56314a5ceeb05ad47c78cf6d /src/anytun.cpp
parentfixed build on linux (diff)
added extra catch for std::runtime_error
Diffstat (limited to 'src/anytun.cpp')
-rw-r--r--src/anytun.cpp15
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)