From: Tomi Valkeinen Date: Tue, 19 Nov 2013 05:10:31 +0000 (+0200) Subject: lib: fix error handling X-Git-Tag: 0.18_rc0~187 X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;h=075d53dde5446fefe121e548156901cf72f7f8e3;hp=075d53dde5446fefe121e548156901cf72f7f8e3;p=notmuch lib: fix error handling Currently if a Xapian exception happens in notmuch_message_get_header, the exception is not caught leading to crash. In notmuch_message_get_date the exception is caught, but an internal error is raised, again leading to crash. This patch fixes the error handling by making both functions catch the Xapian exceptions, print an error and return NULL or 0. The 'notmuch->exception_reported' is also set, as is done elsewhere, even if I don't really get the idea of that field. Signed-off-by: Tomi Valkeinen ---