- /* Get filename list. Here we get only the terms. We lazily
- * expand them to full file names when needed in
- * _notmuch_message_ensure_filename_list. */
- assert (strcmp (type_prefix, filename_prefix) < 0);
- if (!message->filename_term_list && !message->filename_list)
- message->filename_term_list =
- _notmuch_database_get_terms_with_prefix (message, i, end,
- filename_prefix);
-
-
- /* Get property terms. Mimic the setup with filenames above */
- assert (strcmp (filename_prefix, property_prefix) < 0);
- if (!message->property_map && !message->property_term_list)
- message->property_term_list =
- _notmuch_database_get_terms_with_prefix (message, i, end,
- property_prefix);
-
- /* Get reply to */
- assert (strcmp (property_prefix, replyto_prefix) < 0);
- if (!message->in_reply_to)
- message->in_reply_to =
- _notmuch_message_get_term (message, i, end, replyto_prefix);
-
-
- /* It's perfectly valid for a message to have no In-Reply-To
- * header. For these cases, we return an empty string. */
- if (!message->in_reply_to)
- message->in_reply_to = talloc_strdup (message, "");
+ /* It's perfectly valid for a message to have no In-Reply-To
+ * header. For these cases, we return an empty string. */
+ if (!message->in_reply_to)
+ message->in_reply_to = talloc_strdup (message, "");
+
+ /* all the way without an exception */
+ break;
+ } catch (const Xapian::DatabaseModifiedError &error) {
+ notmuch_status_t status = _notmuch_database_reopen (message->notmuch);
+ if (status != NOTMUCH_STATUS_SUCCESS)
+ INTERNAL_ERROR ("unhandled error from notmuch_database_reopen: %s\n",
+ notmuch_status_to_string (status));
+ } catch (const Xapian::Error &error) {
+ INTERNAL_ERROR ("A Xapian exception occurred fetching message metadata: %s\n",
+ error.get_msg().c_str());
+ }
+ }
+ message->last_view = message->notmuch->view;