From 8366e009cb1857126755b6230a1986de1158f6ff Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sun, 31 Dec 2023 07:50:54 +0200 Subject: [PATCH] xapian-db: handle doc-not-found error in catch handler --- lib/mu-xapian-db.hh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/mu-xapian-db.hh b/lib/mu-xapian-db.hh index dd179157..91de8764 100644 --- a/lib/mu-xapian-db.hh +++ b/lib/mu-xapian-db.hh @@ -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) {