]> git.notmuchmail.org Git - notmuch/commitdiff
lib: use LOG_XAPIAN_EXCEPTION in n_m_get_date
authorDavid Bremner <david@tethera.net>
Sun, 5 Jul 2020 13:00:17 +0000 (10:00 -0300)
committerDavid Bremner <david@tethera.net>
Tue, 14 Jul 2020 10:12:52 +0000 (07:12 -0300)
This should not change functionality, but does slightly reduce code
duplication. Perhaps more importantly it allows consistent changes to
all of the similar exception handling in message.cc.

lib/message.cc

index 8e43a393c55171b425175537298c0ff0fecb6c3b..f4306e2cacb6a780b51df44b68c7508f9edcc3b8 100644 (file)
@@ -1191,9 +1191,7 @@ notmuch_message_get_date (notmuch_message_t *message)
     try {
        value = message->doc.get_value (NOTMUCH_VALUE_TIMESTAMP);
     } catch (Xapian::Error &error) {
     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;
     }
 
        return 0;
     }