From 6b1d0898d57ef91e552d79d90fd6bb3c8d6e584c Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Tue, 17 Jul 2018 11:15:34 +0200 Subject: [PATCH] Print a message when we fail to open a zim file. --- kiwixapp.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kiwixapp.cpp b/kiwixapp.cpp index 7732617..2ad9107 100644 --- a/kiwixapp.cpp +++ b/kiwixapp.cpp @@ -1,4 +1,5 @@ #include "kiwixapp.h" +#include "zim/error.h" KiwixApp::KiwixApp(int& argc, char *argv[]) : QApplication(argc, argv), @@ -21,7 +22,12 @@ void KiwixApp::openZimFile(const QString &zimfile) std::cout << "Opening " << zimfile_ << std::endl; try { reader = new kiwix::Reader(zimfile_); - } catch (...) { + } catch (const zim::ZimFileFormatError& e) { + std::cout << "Cannot open " << zimfile_ << std::endl; + std::cout << e.what() << std::endl; + reader = nullptr; + } catch (const std::exception& e) { + std::cout << "oup" << e.what() << std::endl; reader = nullptr; } }