Skip to content

Commit

Permalink
Merge pull request #1081 from kiwix/kiwix_Downloader_close_may_throw
Browse files Browse the repository at this point in the history
Handling of exceptions from kiwix::Downloader::close()
  • Loading branch information
kelson42 authored Apr 12, 2024
2 parents ccccc80 + 11cdeb9 commit 0b18cc6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/kiwixapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@ KiwixApp::~KiwixApp()
{
m_server.stop();
if (mp_downloader) {
mp_downloader->close();
try {
mp_downloader->close();
} catch (const std::exception& err) {
std::cerr << "ERROR: Failed to save the downloader state: "
<< err.what() << std::endl;
}
delete mp_downloader;
}
if (mp_manager) {
Expand Down

0 comments on commit 0b18cc6

Please sign in to comment.