mirror of
https://github.com/falcosecurity/falco.git
synced 2026-05-13 18:22:40 +00:00
The methods that throw exceptions from stringified results need to additionally pass a rules_contents_t struct. This also meant that they need to call the filename + content version of load_rules. To avoid some duplicate code between the two load_rules_file methods, move the work of opening the file into a private method read_file(). It can throw an exception, which is passed through for the void return method and caught + converted into a load_result error for the method that returns a load_result. Also, to avoid duplicate code between the void load_rules and load_rules_file methods, add a private method interpret_load_result() which throws an exception if the result has an error and prints warnings otherwise if verbose is true. Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
13 KiB
13 KiB