Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add extra safety in database blocks

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
  • Loading branch information...
commit c9a2b9b3817575a6b7356898e3507c5c2522600e 1 parent 4507ece
@felipec authored
Showing with 10 additions and 4 deletions.
  1. +10 −4 notmuch-ruby.vim
View
14 notmuch-ruby.vim
@@ -406,14 +406,20 @@ ruby << EOF
def do_write
db = Notmuch::Database.new($db_name, :mode => Notmuch::MODE_READ_WRITE)
- yield db
- db.close
+ begin
+ yield db
+ ensure
+ db.close
+ end
end
def do_read
db = Notmuch::Database.new($db_name)
- yield db
- db.close
+ begin
+ yield db
+ ensure
+ db.close
+ end
end
def open_reply(orig)
Please sign in to comment.
Something went wrong with that request. Please try again.