mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-23 03:58:56 -04:00
Print a message when we fail to open a zim file.
This commit is contained in:
parent
9aa37e9b9c
commit
6b1d0898d5
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user