Skip to content

Commit

Permalink
fix(userspace/falco): in case output_file cannot be opened, throw a f…
Browse files Browse the repository at this point in the history
…alco exception.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
  • Loading branch information
FedeDP authored and poiana committed Dec 9, 2021
1 parent b5667ca commit 9dcd8bc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions userspace/falco/outputs_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ void falco::outputs::output_file::open_file()
if(!m_outfile.is_open())
{
m_outfile.open(m_oc.options["filename"], fstream::app);
if (m_outfile.fail())
{
throw falco_exception("failed to open output file " + m_oc.options["filename"]);
}
}
}

Expand Down

0 comments on commit 9dcd8bc

Please sign in to comment.