Fix exception handler for --library on OS X

refs #8227
This commit is contained in:
Gunnar Beutner 2015-02-13 09:19:01 +01:00
parent 9fe52d0dc1
commit 0f2598b43b

View File

@ -264,25 +264,15 @@ int Main(void)
} }
if (vm.count("library")) { if (vm.count("library")) {
BOOST_FOREACH(const String& libraryName, vm["library"].as<std::vector<std::string> >()) BOOST_FOREACH(const String& libraryName, vm["library"].as<std::vector<std::string> >()) {
{
try { try {
(void)Utility::LoadExtensionLibrary(libraryName); (void) Utility::LoadExtensionLibrary(libraryName);
} } catch (const std::exception& ex) {
#ifdef _WIN32 Log(LogCritical, "icinga-app")
catch (win32_error &ex) { << "Could not load library \"" << libraryName << "\": " << DiagnosticInformation(ex);
if (int const * err = boost::get_error_info<errinfo_win32_error>(ex)) {
Log(LogCritical, "icinga-app", "Could not load library \"" + libraryName + "\"");
return EXIT_FAILURE; return EXIT_FAILURE;
} }
} }
#else /*_WIN32*/
catch (std::runtime_error &ex) {
Log(LogCritical, "icinga-app", "Could not load library \"" + libraryName + "\"");
return EXIT_FAILURE;
}
#endif /*_WIN32*/
}
} }
if (!command || vm.count("help") || vm.count("version")) { if (!command || vm.count("help") || vm.count("version")) {