mirror of
https://github.com/falcosecurity/falco.git
synced 2025-07-06 11:26:44 +00:00
chore: stick with the error messages we have
Because we can't easily change the integration test fixtures. Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
This commit is contained in:
parent
b3171dbae1
commit
253ff64d64
@ -88,7 +88,7 @@ void falco_configuration::init(string conf_filename, list<string> &cmdline_optio
|
|||||||
filename = m_config->get_scalar<string>("file_output", "filename", "");
|
filename = m_config->get_scalar<string>("file_output", "filename", "");
|
||||||
if(filename == string(""))
|
if(filename == string(""))
|
||||||
{
|
{
|
||||||
throw logic_error("error reading config file (" + m_config_file + "): file output enabled but no filename in configuration block");
|
throw logic_error("Error reading config file (" + m_config_file + "): file output enabled but no filename in configuration block");
|
||||||
}
|
}
|
||||||
file_output.options["filename"] = filename;
|
file_output.options["filename"] = filename;
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ void falco_configuration::init(string conf_filename, list<string> &cmdline_optio
|
|||||||
program = m_config->get_scalar<string>("program_output", "program", "");
|
program = m_config->get_scalar<string>("program_output", "program", "");
|
||||||
if(program == string(""))
|
if(program == string(""))
|
||||||
{
|
{
|
||||||
throw logic_error("error reading config file (" + m_config_file + "): program output enabled but no program path in configuration block");
|
throw logic_error("Error reading config file (" + m_config_file + "): program output enabled but no program in configuration block");
|
||||||
}
|
}
|
||||||
program_output.options["program"] = program;
|
program_output.options["program"] = program;
|
||||||
|
|
||||||
@ -139,7 +139,7 @@ void falco_configuration::init(string conf_filename, list<string> &cmdline_optio
|
|||||||
|
|
||||||
if(url == string(""))
|
if(url == string(""))
|
||||||
{
|
{
|
||||||
throw logic_error("error reading config file (" + m_config_file + "): http output enabled but no URL in configuration block");
|
throw logic_error("Error reading config file (" + m_config_file + "): http output enabled but no url in configuration block");
|
||||||
}
|
}
|
||||||
http_output.options["url"] = url;
|
http_output.options["url"] = url;
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ void falco_configuration::init(string conf_filename, list<string> &cmdline_optio
|
|||||||
|
|
||||||
if(m_outputs.size() == 0)
|
if(m_outputs.size() == 0)
|
||||||
{
|
{
|
||||||
throw logic_error("error reading config file (" + m_config_file + "): please configure at least one output");
|
throw logic_error("Error reading config file (" + m_config_file + "): No outputs configured. Please configure at least one output file output enabled but no filename in configuration block");
|
||||||
}
|
}
|
||||||
|
|
||||||
string log_level = m_config->get_scalar<string>("log_level", "info");
|
string log_level = m_config->get_scalar<string>("log_level", "info");
|
||||||
@ -186,7 +186,7 @@ void falco_configuration::init(string conf_filename, list<string> &cmdline_optio
|
|||||||
|
|
||||||
if((it = std::find_if(falco_common::priority_names.begin(), falco_common::priority_names.end(), comp)) == falco_common::priority_names.end())
|
if((it = std::find_if(falco_common::priority_names.begin(), falco_common::priority_names.end(), comp)) == falco_common::priority_names.end())
|
||||||
{
|
{
|
||||||
throw logic_error("error reading config file (" + m_config_file + "): unknown priority \"" + priority + "\", it must be one of emergency, alert, critical, error, warning, notice, informational, debug");
|
throw logic_error("Unknown priority \"" + priority + "\"--must be one of emergency, alert, critical, error, warning, notice, informational, debug");
|
||||||
}
|
}
|
||||||
m_min_priority = (falco_common::priority_type)(it - falco_common::priority_names.begin());
|
m_min_priority = (falco_common::priority_type)(it - falco_common::priority_names.begin());
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ void falco_configuration::init(string conf_filename, list<string> &cmdline_optio
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw logic_error("error reading config file (" + m_config_file + "): syscall event drop action " + act + " must be one of \"ignore\", \"log\", \"alert\", or \"exit\"");
|
throw logic_error("Error reading config file (" + m_config_file + "): syscall event drop action " + act + " must be one of \"ignore\", \"log\", \"alert\", or \"exit\"");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -333,7 +333,7 @@ void falco_configuration::set_cmdline_option(const string &opt)
|
|||||||
|
|
||||||
if(!split(opt, '=', keyval))
|
if(!split(opt, '=', keyval))
|
||||||
{
|
{
|
||||||
throw logic_error("error parsing config option \"" + opt + "\", it must be of the form key=val or key.subkey=val");
|
throw logic_error("Error parsing config option \"" + opt + "\". Must be of the form key=val or key.subkey=val");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(split(keyval.first, '.', subkey))
|
if(split(keyval.first, '.', subkey))
|
||||||
|
@ -1249,7 +1249,7 @@ int falco_init(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
catch(exception &e)
|
catch(exception &e)
|
||||||
{
|
{
|
||||||
display_fatal_err("runtime error: " + string(e.what()) + ".\n");
|
display_fatal_err("Runtime error: " + string(e.what()) + ". Exiting.\n");
|
||||||
|
|
||||||
result = EXIT_FAILURE;
|
result = EXIT_FAILURE;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user