diff options
author | Robin Houston <robin@lenny.robin> | 2011-06-29 21:29:12 +0100 |
---|---|---|
committer | Robin Houston <robin@lenny.robin> | 2011-06-29 21:29:12 +0100 |
commit | c923a0213abe3686da66db5c0a8db86075ef505a (patch) | |
tree | 5b9ea9f05534c8a0adb10cb9b1c56329e978c238 | |
parent | 2092e75f2b6bd6c4260f37c60f3e39665d5b0873 (diff) |
Give a more useful exception message if the Xapian database cannot be opened, including the database path and actual error
-rw-r--r-- | vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb b/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb index d8f0adaa3..2f66b68be 100644 --- a/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb +++ b/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb @@ -98,7 +98,7 @@ module ActsAsXapian # make the directory for the xapian databases to go in Dir.mkdir(db_parent_path) unless File.exists?(db_parent_path) - @@db_path = File.join(db_parent_path, environment) + @@db_path = File.join(db_parent_path, environment) # make some things that don't depend on the db # XXX this gets made once for each acts_as_xapian. Oh well. @@ -124,8 +124,8 @@ module ActsAsXapian begin @@db = Xapian::Database.new(@@db_path) @@enquire = Xapian::Enquire.new(@@db) - rescue IOError - raise "Xapian database not opened; have you built it with scripts/rebuild-xapian-index ?" + rescue IOError => e + raise "Failed to open Xapian database #{@@db_path}: #{e.message}" end init_query_parser |