unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Austin Clements <amdragon@MIT.EDU>
To: notmuch@notmuchmail.org
Cc: tomi.ollila@iki.fi
Subject: [PATCH v2 4/5] ruby: Update for changes to notmuch_database_get_directory
Date: Sun, 13 May 2012 19:36:12 -0400	[thread overview]
Message-ID: <1336952173-17422-5-git-send-email-amdragon@mit.edu> (raw)
In-Reply-To: <1336952173-17422-1-git-send-email-amdragon@mit.edu>

---
 bindings/ruby/database.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/bindings/ruby/database.c b/bindings/ruby/database.c
index 409d54f..e84f726 100644
--- a/bindings/ruby/database.c
+++ b/bindings/ruby/database.c
@@ -252,6 +252,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 +261,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;
 }
 
 /*
-- 
1.7.10

  parent reply	other threads:[~2012-05-13 23:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-13 19:57 [PATCH 0/5] Fix notmuch_database_get_directory API Austin Clements
2012-05-13 19:57 ` [PATCH 1/5] lib/cli: Make notmuch_database_get_directory return a status code Austin Clements
2012-05-13 19:57 ` [PATCH 2/5] go: Update for changes to notmuch_database_get_directory Austin Clements
2012-05-13 21:51   ` Justus Winter
2012-05-13 23:15     ` Austin Clements
2012-05-13 19:57 ` [PATCH 3/5] python: " Austin Clements
2012-05-13 19:57 ` [PATCH 4/5] ruby: " Austin Clements
2012-05-13 19:57 ` [PATCH 5/5] news: " Austin Clements
2012-05-13 20:49 ` [PATCH 0/5] Fix notmuch_database_get_directory API Tomi Ollila
2012-05-13 21:55   ` Justus Winter
2012-05-13 23:36 ` [PATCH v2 " Austin Clements
2012-05-13 23:36   ` [PATCH v2 1/5] lib/cli: Make notmuch_database_get_directory return a status code Austin Clements
2012-05-13 23:36   ` [PATCH v2 2/5] go: Update for changes to notmuch_database_get_directory Austin Clements
2012-05-13 23:36   ` [PATCH v2 3/5] python: " Austin Clements
2012-05-13 23:36   ` Austin Clements [this message]
2012-05-13 23:36   ` [PATCH v2 5/5] news: " Austin Clements
2012-05-15 12:04   ` [PATCH v2 0/5] Fix notmuch_database_get_directory API David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1336952173-17422-5-git-send-email-amdragon@mit.edu \
    --to=amdragon@mit.edu \
    --cc=notmuch@notmuchmail.org \
    --cc=tomi.ollila@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).