From 1c68cf87b90d5af9e2503dbae2f62c6fc19df78a Mon Sep 17 00:00:00 2001 From: Kelson Date: Mon, 17 Oct 2016 13:16:43 +0200 Subject: [PATCH] Fix ft index open for chunked files #346 --- src/common/kiwix/xapianSearcher.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/common/kiwix/xapianSearcher.cpp b/src/common/kiwix/xapianSearcher.cpp index 6d895aa6d..d17b9207d 100644 --- a/src/common/kiwix/xapianSearcher.cpp +++ b/src/common/kiwix/xapianSearcher.cpp @@ -40,14 +40,13 @@ namespace kiwix { { zim::File zimFile = zim::File(directoryPath); zim::Article xapianArticle = zimFile.getArticle('Z', "/fulltextIndex/xapian"); - if ( ! xapianArticle.good()) - throw NoXapianIndexInZim(); + if (!xapianArticle.good()) + throw NoXapianIndexInZim(); zim::offset_type dbOffset = xapianArticle.getOffset(); int databasefd = open(directoryPath.c_str(), O_RDONLY); lseek(databasefd, dbOffset, SEEK_SET); this->readableDatabase = Xapian::Database(databasefd); - } catch (zim::ZimFileFormatError) - { + } catch (...) { this->readableDatabase = Xapian::Database(directoryPath); } }