diff --git a/src/TDB2.cpp b/src/TDB2.cpp
index aab85a8e9..eae5a82b5 100644
--- a/src/TDB2.cpp
+++ b/src/TDB2.cpp
@@ -34,6 +34,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -51,7 +52,11 @@ static void dependency_scan(std::vector&);
////////////////////////////////////////////////////////////////////////////////
void TDB2::open_replica(const std::string& location, bool create_if_missing) {
- _replica = tc::new_replica_on_disk(location, create_if_missing);
+ try {
+ _replica = tc::new_replica_on_disk(location, create_if_missing);
+ } catch (rust::Error& err) {
+ throw format("Could not open replica at {1}: {2}", location, err.what());
+ }
}
////////////////////////////////////////////////////////////////////////////////