[PATCH 02/11] lib: use LOG_XAPIAN_EXCEPTION in n_m_get_date

Subject: [PATCH 02/11] lib: use LOG_XAPIAN_EXCEPTION in n_m_get_date

Date: Sun, 5 Jul 2020 10:00:17 -0300

To: notmuch@notmuchmail.org

Cc: David Bremner

From: David Bremner


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 | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/message.cc b/lib/message.cc
index 81278d5e..6d78663b 100644
--- a/lib/message.cc
+++ b/lib/message.cc
@@ -1216,9 +1216,7 @@ notmuch_message_get_date (notmuch_message_t *message)
     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;
     }
 
-- 
2.27.0
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: