From 483fcd84d06a670caf297e9e9a06f0fa87f04d5f Mon Sep 17 00:00:00 2001 From: Julian Brost Date: Wed, 27 Jan 2021 15:52:37 +0100 Subject: [PATCH] Try to log useful information for exceptions thrown by RunWorker --- lib/cli/daemoncommand.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/cli/daemoncommand.cpp b/lib/cli/daemoncommand.cpp index 7c23086ef..1076510d1 100644 --- a/lib/cli/daemoncommand.cpp +++ b/lib/cli/daemoncommand.cpp @@ -518,6 +518,9 @@ static pid_t StartUnixWorker(const std::vector& configs, bool close } _exit(RunWorker(configs, closeConsoleLog, stderrFile)); + } catch (const std::exception& ex) { + Log(LogCritical, "cli") << "Exception in main process: " << DiagnosticInformation(ex); + _exit(EXIT_FAILURE); } catch (...) { _exit(EXIT_FAILURE); } @@ -682,6 +685,9 @@ int DaemonCommand::Run(const po::variables_map& vm, const std::vector