From 591f901241623fbc50b67dbcff88c68cb33c53fd Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sun, 22 Nov 2009 03:41:30 +0100 Subject: [PATCH] Print information about where Xapian exception occurred. Previously, our Xapian exception reports where identical so they were hard to track down. --- lib/database.cc | 10 +++++----- lib/query.cc | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/database.cc b/lib/database.cc index 95057a8f..f3cac910 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -513,7 +513,7 @@ notmuch_database_open (const char *path, notmuch->query_parser->add_prefix (prefix->name, prefix->prefix); } } catch (const Xapian::Error &error) { - fprintf (stderr, "A Xapian exception occurred: %s\n", + fprintf (stderr, "A Xapian exception occurred opening database: %s\n", error.get_msg().c_str()); notmuch = NULL; } @@ -608,8 +608,8 @@ notmuch_database_set_timestamp (notmuch_database_t *notmuch, db->replace_document (doc_id, doc); } - } catch (Xapian::Error &error) { - fprintf (stderr, "A Xapian exception occurred: %s.\n", + } catch (const Xapian::Error &error) { + fprintf (stderr, "A Xapian exception occurred setting timestamp: %s.\n", error.get_msg().c_str()); ret = NOTMUCH_STATUS_XAPIAN_EXCEPTION; } @@ -983,8 +983,8 @@ notmuch_database_add_message (notmuch_database_t *notmuch, _notmuch_message_sync (message); } catch (const Xapian::Error &error) { - fprintf (stderr, "A Xapian exception occurred: %s.\n", - error.get_msg().c_str()); + fprintf (stderr, "A Xapian exception occurred adding message: %s.\n", + error.get_description().c_str()); ret = NOTMUCH_STATUS_XAPIAN_EXCEPTION; goto DONE; } diff --git a/lib/query.cc b/lib/query.cc index ea521dd8..4a686832 100644 --- a/lib/query.cc +++ b/lib/query.cc @@ -149,7 +149,7 @@ notmuch_query_search_messages (notmuch_query_t *query, } } catch (const Xapian::Error &error) { - fprintf (stderr, "A Xapian exception occurred: %s\n", + fprintf (stderr, "A Xapian exception occurred performing query: %s\n", error.get_msg().c_str()); fprintf (stderr, "Query string was: %s\n", query->query_string); } -- 2.26.2