Log and ignore exceptions on failure to write data to disk for temporary storage

This commit is contained in:
Aleksei Nikiforov 2020-02-07 17:54:59 +03:00
parent 7f28de5a99
commit 390dd83733

View File

@ -381,7 +381,18 @@ void auparse_callback(auparse_state_t *au, auparse_cb_event_t cb_event_type, voi
{
audit_record->filename = callback_data->data_directory + boost::filesystem::path::separator + generate_name_for_audit_record(*audit_record);
boost::property_tree::write_json(audit_record->filename, audit_record->toPtree());
try
{
boost::property_tree::write_json(audit_record->filename, audit_record->toPtree());
}
catch (const std::exception &e)
{
Logger::write("Caught exception while saving data to disk: %s", e.what());
}
catch (...)
{
Logger::write("Caught unknown exception while saving data to disk");
}
}
if (callback_data->clickhouse_client && (!callback_data->table_name.empty()))