xapian-db: handle doc-not-found error in catch handler

This commit is contained in:
Dirk-Jan C. Binnema 2023-12-31 07:50:54 +02:00
parent bae290e718
commit 8366e009cb
1 changed files with 3 additions and 0 deletions

View File

@ -85,6 +85,9 @@ try {
} catch (const Xapian::DatabaseCorruptError& dcerr) {
return Err(Error{Error::Code::Xapian, "failed to read database"}.
add_hint("Try (re)creating using `mu index'"));
} catch (const Xapian::DocNotFoundError& dnferr) {
return Err(Error{Error::Code::Xapian, "message not found in database"}.
add_hint("Try reopening the database"));
} catch (const Xapian::Error& xerr) {
return Err(Error::Code::Xapian, "{}", xerr.get_error_string());
} catch (const std::runtime_error& re) {