]> git.notmuchmail.org Git - notmuch/commit
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)
commit075d53dde5446fefe121e548156901cf72f7f8e3
tree1d92f862716e05da29f159dbea447962db35c84b
parent40a3bf7e68338d34d10ddc77f746af53ff6d3182
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 <tomi.valkeinen@iki.fi>
lib/message.cc