Print a message when we fail to open a zim file.

This commit is contained in:
Matthieu Gautier 2018-07-17 11:15:34 +02:00
parent 9aa37e9b9c
commit 6b1d0898d5

View File

@ -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;
}
}