From 11cdeb9faa368014d2e3b6741bdd8f0f784b692a Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Thu, 11 Apr 2024 16:31:10 +0400 Subject: [PATCH] Handle exceptions from kiwix::Downloader::close() --- src/kiwixapp.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/kiwixapp.cpp b/src/kiwixapp.cpp index fb59a933..45650ddc 100644 --- a/src/kiwixapp.cpp +++ b/src/kiwixapp.cpp @@ -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) {