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;
}
}
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;
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);
}
try {
value = message->doc.get_value (NOTMUCH_VALUE_TIMESTAMP);
} catch (Xapian::Error &error) {
- _notmuch_database_log (notmuch_message_get_database (message), "A Xapian exception occurred when reading date: %s\n",
- error.get_msg ().c_str ());
- message->notmuch->exception_reported = true;
+ LOG_XAPIAN_EXCEPTION (message, error);
return 0;
}
{
notmuch_tags_t *tags;
- _notmuch_message_ensure_metadata (message, message->tag_list);
+ try {
+ _notmuch_message_ensure_metadata (message, message->tag_list);
+ } catch (Xapian::Error &error) {
+ LOG_XAPIAN_EXCEPTION (message, error);
+ return NULL;
+ }
tags = _notmuch_tags_create (message, message->tag_list);
/* _notmuch_tags_create steals the reference to the tag_list, but