]> git.notmuchmail.org Git - notmuch/commitdiff
Print information about where Xapian exception occurred.
authorCarl Worth <cworth@cworth.org>
Sun, 22 Nov 2009 02:41:30 +0000 (03:41 +0100)
committerCarl Worth <cworth@cworth.org>
Sun, 22 Nov 2009 02:51:35 +0000 (03:51 +0100)
Previously, our Xapian exception reports where identical so they
were hard to track down.

lib/database.cc
lib/query.cc

index 95057a8fa0a0fec98d557ab861ee850652aec4a7..f3cac9109ecf67c253730ee95ef39448abcf4450 100644 (file)
@@ -513,7 +513,7 @@ notmuch_database_open (const char *path,
            notmuch->query_parser->add_prefix (prefix->name, prefix->prefix);
        }
     } catch (const Xapian::Error &error) {
            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;
     }
                 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);
        }
 
            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;
     }
                 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) {
 
        _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;
     }
        ret = NOTMUCH_STATUS_XAPIAN_EXCEPTION;
        goto DONE;
     }
index ea521dd822faac03719be787d4bd82f708ca2f77..4a686832dc4343e62a0c3e13fb2a244ccf45ae7f 100644 (file)
@@ -149,7 +149,7 @@ notmuch_query_search_messages (notmuch_query_t *query,
        }
 
     } catch (const Xapian::Error &error) {
        }
 
     } 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);
     }
                 error.get_msg().c_str());
        fprintf (stderr, "Query string was: %s\n", query->query_string);
     }