mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-23 17:57:54 +02:00
Merge pull request #8777 from Icinga/bugfix/runworker-exceptions-2.12
Improve handling of exceptions thrown by RunWorker (2.12)
This commit is contained in:
commit
6ceba45739
@ -518,6 +518,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);
|
||||
}
|
||||
@ -680,7 +683,14 @@ 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;
|
||||
}
|
||||
#else /* _WIN32 */
|
||||
l_UmbrellaPid = getpid();
|
||||
Application::SetUmbrellaProcess(l_UmbrellaPid);
|
||||
|
Loading…
x
Reference in New Issue
Block a user