update to use fmt-based apis

Not complete, but a first big stab converting users of Mu::Error and
various g_warning & friends, format to the new libfmt-based APIs.
This commit is contained in:
Dirk-Jan C. Binnema
2023-07-05 23:10:13 +03:00
parent 742ca33740
commit 4920b56671
46 changed files with 435 additions and 449 deletions

View File

@ -102,8 +102,8 @@ XapianDb::make(const std::string& db_path, Flavor flavor) noexcept try {
g_setenv("XAPIAN_FLUSH_THRESHOLD", "500000", 1);
/* create path if needed */
if (g_mkdir_with_parents(db_path.c_str(), 0700) != 0)
return Err(Error::Code::File, "failed to create database dir %s: %s",
db_path.c_str(), ::strerror(errno));
return Err(Error::Code::File, "failed to create database dir {}: {}",
db_path, ::strerror(errno));
}
switch (flavor) {
@ -125,12 +125,12 @@ XapianDb::make(const std::string& db_path, Flavor flavor) noexcept try {
}
} catch (const Xapian::DatabaseLockError& xde) {
return Err(Error::Code::StoreLock, "%s", xde.get_msg().c_str());
return Err(Error::Code::StoreLock, "{}", xde.get_msg());
} catch (const Xapian::DatabaseError& xde) {
return Err(Error::Code::Store, "%s", xde.get_msg().c_str());
return Err(Error::Code::Store, "{}", xde.get_msg());
} catch (const Mu::Error& me) {
return Err(me);
} catch (...) {
return Err(Error::Code::Internal,
"something went wrong when opening store @ %s", db_path.c_str());
"something went wrong when opening store @ {}", db_path);
}