diff --git a/lib/sbdb/db.rb b/lib/sbdb/db.rb index b0beb95..1b0262e 100644 --- a/lib/sbdb/db.rb +++ b/lib/sbdb/db.rb @@ -82,9 +82,13 @@ module SBDB txn = opts[:txn] # First is the global txn, second only for open. begin @db.open txn && txn.bdb_object, file, opts[:name], opts[:type], opts[:flags] || 0, opts[:mode] || 0 - rescue Object + rescue Exception => exc close - raise $! + exc.backtrace.unshift "Trying to open #{open[:env] && "in #{open[:env]].home} "}database #{file} #{opts[:name]}" + raise exc + rescue + close + raise Object end end diff --git a/sbdb.gemspec b/sbdb.gemspec index acb0125..13badf0 100644 --- a/sbdb.gemspec +++ b/sbdb.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |s| s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Denis Knauf"] - s.date = %q{2010-03-29} + s.date = %q{2010-04-14} s.description = %q{Simple Ruby Berkeley DB wrapper library for bdb.} s.email = %q{Denis.Knauf@gmail.com} s.extra_rdoc_files = [