diff options
author | Carl Worth <cworth@cworth.org> | 2010-04-24 07:22:34 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-04-24 07:27:50 -0700 |
commit | 9ef68f1444de981c47af06c948e3aa3ca5a377c8 (patch) | |
tree | 6736b6a96e51378374997c7ae6d9a805eb39db24 /lib/notmuch.h | |
parent | 3dbef312fbe9b8da247106a177ac58d73b9b9e92 (diff) |
lib: Audit all notmuch_database call for Xapian exception handling.
Our current approach is for top-level entry poitns in the library
to have try/catch blocks that catch any Xapian exception and print
a message. Add a few missing blocks and fix up the documentation.
Diffstat (limited to 'lib/notmuch.h')
-rw-r--r-- | lib/notmuch.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/notmuch.h b/lib/notmuch.h index bae48a65..921b0fcf 100644 --- a/lib/notmuch.h +++ b/lib/notmuch.h @@ -219,6 +219,8 @@ notmuch_database_upgrade (notmuch_database_t *database, * Here, 'path' should be a path relative to the path of 'database' * (see notmuch_database_get_path), or else should be an absolute path * with initial components that match the path of 'database'. + * + * Can return NULL if a Xapian exception occurs. */ notmuch_directory_t * notmuch_database_get_directory (notmuch_database_t *database, @@ -246,6 +248,9 @@ notmuch_database_get_directory (notmuch_database_t *database, * * NOTMUCH_STATUS_SUCCESS: Message successfully added to database. * + * NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred, + * message not added. + * * NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID: Message has the same message * ID as another message already in the database. The new * filename was successfully added to the message in the database @@ -280,6 +285,9 @@ notmuch_database_add_message (notmuch_database_t *database, * NOTMUCH_STATUS_SUCCESS: The last filename was removed and the * message was removed from the database. * + * NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred, + * message not removed. + * * NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID: This filename was removed but * the message persists in the database with at least one other * filename. @@ -297,8 +305,11 @@ notmuch_database_remove_message (notmuch_database_t *database, * a new notmuch_message_t object is returned. The caller should call * notmuch_message_destroy when done with the message. * - * If no message is found with the given message_id or if an - * out-of-memory situation occurs, this function returns NULL. + * This function returns NULL in the following situations: + * + * * No message is found with the given message_id + * * An out-of-memory situation occurs + * * A Xapian exception occurs */ notmuch_message_t * notmuch_database_find_message (notmuch_database_t *database, |