xapian-db: use get_msg on exception

We were using get_error_string, but that might be NULL,
which libfmt doesn't like much.
This commit is contained in:
Dirk-Jan C. Binnema 2024-03-15 22:44:32 +02:00
parent 3660ad9ed7
commit 5dfb4e9dd6
1 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/*
** Copyright (C) 2023 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
** Copyright (C) 2024 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
**
** This program is free software; you can redistribute it and/or modify it
** under the terms of the GNU General Public License as published by the
@ -89,7 +89,7 @@ try {
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());
return Err(Error::Code::Xapian, "{}", xerr.get_msg());
} catch (const std::runtime_error& re) {
return Err(Error::Code::Internal, "runtime error: {}", re.what());
} catch (const std::exception& e) {