X-Git-Url: http://rtime.felk.cvut.cz/gitweb/notmuch.git/blobdiff_plain/9721343e5b75e0e5a305ef32358fd83dcde650b4..034102303eb4a2577ea06a453241fed6fe882322:/bindings/ruby/database.c diff --git a/bindings/ruby/database.c b/bindings/ruby/database.c index 409d54fa..c03d7011 100644 --- a/bindings/ruby/database.c +++ b/bindings/ruby/database.c @@ -113,11 +113,13 @@ notmuch_rb_database_open (int argc, VALUE *argv, VALUE klass) VALUE notmuch_rb_database_close (VALUE self) { + notmuch_status_t ret; notmuch_database_t *db; Data_Get_Notmuch_Database (self, db); - notmuch_database_destroy (db); + ret = notmuch_database_destroy (db); DATA_PTR (self) = NULL; + notmuch_rb_status_raise (ret); return Qnil; } @@ -252,6 +254,7 @@ VALUE notmuch_rb_database_get_directory (VALUE self, VALUE pathv) { const char *path; + notmuch_status_t ret; notmuch_directory_t *dir; notmuch_database_t *db; @@ -260,11 +263,11 @@ notmuch_rb_database_get_directory (VALUE self, VALUE pathv) SafeStringValue (pathv); path = RSTRING_PTR (pathv); - dir = notmuch_database_get_directory (db, path); - if (!dir) - rb_raise (notmuch_rb_eXapianError, "Xapian exception"); - - return Data_Wrap_Struct (notmuch_rb_cDirectory, NULL, NULL, dir); + ret = notmuch_database_get_directory (db, path, &dir); + notmuch_rb_status_raise (ret); + if (dir) + return Data_Wrap_Struct (notmuch_rb_cDirectory, NULL, NULL, dir); + return Qnil; } /*