provide end-user hints and show them

Only a few for now.
This commit is contained in:
Dirk-Jan C. Binnema
2023-09-16 11:07:03 +03:00
parent 3123f3e983
commit c78dafd723
3 changed files with 11 additions and 23 deletions

View File

@ -77,7 +77,8 @@ xapian_try_result(Func&& func) noexcept -> std::decay_t<decltype(func())>
try {
return func();
} catch (const Xapian::DatabaseLockError& dlerr) {
return Err(Error::Code::StoreLock, "database locked");
return Err(Error{Error::Code::StoreLock, "database locked"}.
add_hint("Perhaps mu is already running?"));
} catch (const Xapian::Error& xerr) {
return Err(Error::Code::Xapian, "{}", xerr.get_error_string());
} catch (const std::runtime_error& re) {