Skip to content

Commit

Permalink
lib/libcdb.rb (CDB.open): Don't clobber original error on close.
Browse files Browse the repository at this point in the history
  • Loading branch information
blackwinter committed Jun 11, 2013
1 parent cf1d3ac commit a4a7984
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/libcdb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,15 @@ def open(path, mode = MODE_READ)
begin
yield cdb
ensure
cdb.close
err = $!

begin
cdb.close
rescue
raise unless err
end

raise err if err
end
else
cdb
Expand Down

0 comments on commit a4a7984

Please sign in to comment.