Try to log useful information for exceptions thrown by RunWorker

This commit is contained in:
Julian Brost 2021-01-27 15:52:37 +01:00
parent b1536eac6f
commit 1355341681

View File

@ -479,6 +479,9 @@ static pid_t StartUnixWorker(const std::vector<std::string>& 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<std::strin
#ifdef _WIN32
try {
return RunWorker(configs);
} catch (const std::exception& ex) {
Log(LogCritical, "cli") << "Exception in main process: " << DiagnosticInformation(ex);
return EXIT_FAILURE;
} catch (...) {
return EXIT_FAILURE;
}