Skip to content

Commit

Permalink
Print error when unzipping fails to save a file
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <louise@openrobotics.org>
  • Loading branch information
chapulina committed Mar 3, 2022
1 parent ae90993 commit 1bce241
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Zip.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,17 @@ bool Zip::Extract(const std::string &_src,
if (len < 0)
ignerr << "Error reading " << sb.name << std::endl;
else
{
file.write(buf, len);

igndbg << "Created file [" << dst << "]" << std::endl;
if (file.fail())
{
ignerr << "Failed to write file [" << dst << "]" << std::endl;
}
else
{
igndbg << "Created file [" << dst << "]" << std::endl;
}
}

delete[] buf;
file.close();
Expand Down

0 comments on commit 1bce241

Please sign in to comment.