]> git.notmuchmail.org Git - notmuch/commitdiff
lib: fix error handling
authorTomi Valkeinen <tomi.valkeinen@iki.fi>
Tue, 19 Nov 2013 05:10:31 +0000 (07:10 +0200)
committerDavid Bremner <david@tethera.net>
Sat, 18 Jan 2014 18:47:35 +0000 (14:47 -0400)
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 <tomi.valkeinen@iki.fi>

No differences found