diff options
author | Carl Worth <cworth@cworth.org> | 2009-10-25 09:47:21 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2009-10-25 10:54:43 -0700 |
commit | 3b8e3ab666a54407f9596a53c66ba8ce623ac91d (patch) | |
tree | 683f2e40e8e901d9d6bded6d565dc299ec4d6b7d /query.cc | |
parent | 9f673f3cf866d114edc77080cd9f9e266d403c14 (diff) |
add_message: Propagate error status from notmuch_message_create_for_message_id
What a great feeling to remove an XXX comment.
Diffstat (limited to 'query.cc')
-rw-r--r-- | query.cc | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -165,12 +165,24 @@ notmuch_results_has_more (notmuch_results_t *results) notmuch_message_t * notmuch_results_get (notmuch_results_t *results) { + notmuch_message_t *message; Xapian::docid doc_id; + notmuch_private_status_t status; doc_id = *results->iterator; - return _notmuch_message_create (results, - results->notmuch, doc_id); + message = _notmuch_message_create (results, + results->notmuch, doc_id, + &status); + + if (message == NULL && + status == NOTMUCH_PRIVATE_STATUS_NO_DOCUMENT_FOUND) + { + fprintf (stderr, "Internal error: a results iterator contains a non-existent document ID.\n"); + exit (1); + } + + return message; } void |