Index: omega.cc
===================================================================
--- omega.cc	(revision 11871)
+++ omega.cc	(working copy)
@@ -152,8 +152,8 @@
 	    db.add_database(Xapian::Database(map_dbname_to_dir(dbname)));
 	}
 	enquire = new Xapian::Enquire(db);
-    }
-    catch (const Xapian::Error &) {
+    } catch (const Xapian::Error &e) {
+	error_msg = e.get_msg();
 	enquire = NULL;
     }
 
Index: query.cc
===================================================================
--- query.cc	(revision 11885)
+++ query.cc	(working copy)
@@ -118,7 +118,7 @@
 
 static string queryterms;
 
-static string error_msg;
+string error_msg;
 
 static long int sec = 0, usec = -1;
 
Index: query.h
===================================================================
--- query.h	(revision 11871)
+++ query.h	(working copy)
@@ -1,7 +1,7 @@
 /** @file query.h
  * @brief: Omega functions for running queries, etc.
  *
- * Copyright (C) 2007 Olly Betts
+ * Copyright (C) 2007,2009 Olly Betts
  *
  * 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
@@ -27,6 +27,7 @@
 #include <string>
 
 extern Xapian::Query::op default_op;
+extern std::string error_msg;
 
 void add_bterm(const std::string & term);
 

