diff options
author | Othmar Gsenger <otti@anytun.org> | 2009-01-02 13:57:28 +0000 |
---|---|---|
committer | Othmar Gsenger <otti@anytun.org> | 2009-01-02 13:57:28 +0000 |
commit | cc7a398c28e5b53172471d5d9ab7aa34db15dda1 (patch) | |
tree | a22da91e9911195fcfe999d2eba2d5eb7f7a5383 /src | |
parent | catch exception from anytun-showtables if no/wrong input (diff) |
allways write exceptions to log
Diffstat (limited to 'src')
-rw-r--r-- | src/anytun.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/anytun.cpp b/src/anytun.cpp index 426c500..e995fa8 100644 --- a/src/anytun.cpp +++ b/src/anytun.cpp @@ -514,16 +514,14 @@ int main(int argc, char* argv[]) } catch(std::runtime_error& e) { - if(daemonized) - cLog.msg(Log::PRIO_ERR) << "uncaught runtime error, exiting: " << e.what(); - else + cLog.msg(Log::PRIO_ERR) << "uncaught runtime error, exiting: " << e.what(); + if(!daemonized) std::cout << "uncaught runtime error, exiting: " << e.what() << std::endl; } catch(std::exception& e) { - if(daemonized) - cLog.msg(Log::PRIO_ERR) << "uncaught exception, exiting: " << e.what(); - else + cLog.msg(Log::PRIO_ERR) << "uncaught exception, exiting: " << e.what(); + if(!daemonized) std::cout << "uncaught exception, exiting: " << e.what() << std::endl; } } |