]> git.notmuchmail.org Git - notmuch/commitdiff
Tweak formatting of internal error messages.
authorCarl Worth <cworth@cworth.org>
Wed, 28 Oct 2009 19:46:50 +0000 (12:46 -0700)
committerCarl Worth <cworth@cworth.org>
Wed, 28 Oct 2009 20:13:23 +0000 (13:13 -0700)
Was neglecting to print the phrase "Internal error: " before, and for
the duplicate message-ID error it's nice to actually see the duplicate
IDs.

database.cc
message.cc

index b7fb1f1071a2d6a544e32733c046470b3dcb44bf..f01ffa4b3f186a8945f1981798f46c7c9a09cb28 100644 (file)
@@ -129,6 +129,7 @@ _internal_error (const char *format, ...)
 
     va_start (va_args, format);
 
+    fprintf (stderr, "Internal error: ");
     vfprintf (stderr, format, va_args);
 
     exit (1);
index 60ddf8a8fc53aee2ce533c6d5474ea3e1e98bdc8..75e752c800221f4c99837bf2dcd1a3faec8611ba 100644 (file)
@@ -276,8 +276,10 @@ notmuch_message_get_thread_id (notmuch_message_t *message)
        strncmp ((*i).c_str (), _find_prefix ("thread"),
                 strlen (_find_prefix ("thread"))) == 0)
     {
-       INTERNAL_ERROR ("Message with document ID of %d has duplicate thread IDs.\n",
-                       message->doc_id);
+       INTERNAL_ERROR ("Message %s has duplicate thread IDs: %s and %s\n",
+                       notmuch_message_get_message_id (message),
+                       message->thread_id,
+                       (*i).c_str () + 1);
     }
 #endif