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 d7833a5977
commit 54a8c7b434
1 changed files with 6 additions and 0 deletions

View File

@ -526,6 +526,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);
}
@ -690,6 +693,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;
}