mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-24 22:24:44 +02:00
Merge pull request #8614 from Icinga/bugfix/runworker-exceptions
Improve handling of exceptions thrown by RunWorker
This commit is contained in:
commit
aa4f53009e
@ -526,6 +526,9 @@ static pid_t StartUnixWorker(const std::vector<std::string>& configs, bool close
|
|||||||
}
|
}
|
||||||
|
|
||||||
_exit(RunWorker(configs, closeConsoleLog, stderrFile));
|
_exit(RunWorker(configs, closeConsoleLog, stderrFile));
|
||||||
|
} catch (const std::exception& ex) {
|
||||||
|
Log(LogCritical, "cli") << "Exception in main process: " << DiagnosticInformation(ex);
|
||||||
|
_exit(EXIT_FAILURE);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
_exit(EXIT_FAILURE);
|
_exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
@ -688,7 +691,14 @@ int DaemonCommand::Run(const po::variables_map& vm, const std::vector<std::strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
try {
|
||||||
return RunWorker(configs);
|
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 */
|
#else /* _WIN32 */
|
||||||
l_UmbrellaPid = getpid();
|
l_UmbrellaPid = getpid();
|
||||||
Application::SetUmbrellaProcess(l_UmbrellaPid);
|
Application::SetUmbrellaProcess(l_UmbrellaPid);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user