#include <sstream>
#include <osquery/logger.h>
-#include <osquery/flags.h>
#include <osquery/registry.h>
#include <osquery/utils/conversions/split.h>
#include <osquery/utils/json/json.h>
namespace osquery {
-HIDDEN_FLAG(bool, registry_exceptions, false, "Allow plugin exceptions");
-
RegistryFactory& RegistryFactory::get() {
static RegistryFactory instance;
return instance;
} catch (const std::exception& e) {
LOG(ERROR) << registry_name << " registry " << item_name
<< " plugin caused exception: " << e.what();
- if (FLAGS_registry_exceptions) {
- throw;
- }
return Status(1, e.what());
} catch (...) {
LOG(ERROR) << registry_name << " registry " << item_name
<< " plugin caused unknown exception";
- if (FLAGS_registry_exceptions) {
- throw std::runtime_error(registry_name + ": " + item_name + " failed");
- }
return Status(2, "Unknown exception");
}
}