From 1355341681f5e6527d0806f17adfb49079f0c7e0 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 3fcd55679..dc6cab2bd 100644 --- a/lib/cli/daemoncommand.cpp +++ b/lib/cli/daemoncommand.cpp @@ -479,6 +479,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); } @@ -643,6 +646,9 @@ int DaemonCommand::Run(const po::variables_map& vm, const std::vector