lib: Use Mu:Error exception

Where applicable.
This commit is contained in:
Dirk-Jan C. Binnema
2019-12-30 22:28:53 +02:00
parent dfafecaf0c
commit 97afdd9e3c
7 changed files with 37 additions and 24 deletions

View File

@ -39,6 +39,8 @@
#include <parser/proc-iface.hh>
#include <parser/xapian.hh>
using namespace Mu;
struct MuProc: public Mu::ProcIface {
MuProc (const Xapian::Database& db): db_{db} {}
@ -185,7 +187,7 @@ public:
const auto db = reinterpret_cast<Xapian::Database*>
(mu_store_get_read_only_database (_store));
if (!db)
throw std::runtime_error ("no database");
throw Mu::Error(Error::Code::NotFound, "no database");
return *db;
}
private: