X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fmessage.cc;h=8e43a393c55171b425175537298c0ff0fecb6c3b;hp=b7a64b1c3894c26224e78be165bf58ac445fa777;hb=286161b703e0b5be4d54323970ff88f25f65e0eb;hpb=87d462a20423a25eaf4b54a90bfd538dd93da675 diff --git a/lib/message.cc b/lib/message.cc index b7a64b1c..8e43a393 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -572,9 +572,7 @@ notmuch_message_get_header (notmuch_message_t *message, const char *header) return talloc_strdup (message, value.c_str ()); } catch (Xapian::Error &error) { - _notmuch_database_log (notmuch_message_get_database (message), "A Xapian exception occurred when reading header: %s\n", - error.get_msg ().c_str ()); - message->notmuch->exception_reported = true; + LOG_XAPIAN_EXCEPTION (message, error); return NULL; } } @@ -604,7 +602,12 @@ _notmuch_message_get_in_reply_to (notmuch_message_t *message) const char * notmuch_message_get_thread_id (notmuch_message_t *message) { - _notmuch_message_ensure_metadata (message, message->thread_id); + try { + _notmuch_message_ensure_metadata (message, message->thread_id); + } catch (Xapian::Error &error) { + LOG_XAPIAN_EXCEPTION (message, error); + return NULL; + } if (! message->thread_id) INTERNAL_ERROR ("Message with document ID of %u has no thread ID.\n", message->doc_id); @@ -1119,7 +1122,12 @@ _notmuch_message_ensure_filename_list (notmuch_message_t *message) const char * notmuch_message_get_filename (notmuch_message_t *message) { - _notmuch_message_ensure_filename_list (message); + try { + _notmuch_message_ensure_filename_list (message); + } catch (Xapian::Error &error) { + LOG_XAPIAN_EXCEPTION (message, error); + return NULL; + } if (message->filename_list == NULL) return NULL; @@ -1135,7 +1143,12 @@ notmuch_message_get_filename (notmuch_message_t *message) notmuch_filenames_t * notmuch_message_get_filenames (notmuch_message_t *message) { - _notmuch_message_ensure_filename_list (message); + try { + _notmuch_message_ensure_filename_list (message); + } catch (Xapian::Error &error) { + LOG_XAPIAN_EXCEPTION (message, error); + return NULL; + } return _notmuch_filenames_create (message, message->filename_list); }