From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id E41806DE2E31 for ; Fri, 14 Jul 2017 19:01:35 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.001 X-Spam-Level: X-Spam-Status: No, score=-0.001 tagged_above=-999 required=5 tests=[AWL=0.010, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KbW2aODf0OeI for ; Fri, 14 Jul 2017 19:01:35 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 472B06DE2E26 for ; Fri, 14 Jul 2017 19:01:35 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1dWCLW-0004s1-Jy; Fri, 14 Jul 2017 21:58:14 -0400 Received: (nullmailer pid 16393 invoked by uid 1000); Sat, 15 Jul 2017 02:01:31 -0000 From: David Bremner To: notmuch@notmuchmail.org, notmuch@freelists.org Subject: [PATCH] cli/new: improve error reporting Date: Fri, 14 Jul 2017 23:01:26 -0300 Message-Id: <20170715020126.16349-1-david@tethera.net> X-Mailer: git-send-email 2.13.2 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2017 02:01:36 -0000 Recently a user reported a crash in notmuch new, but because of missing error reporting, all they could say was "A Xapian exception occured". This commit adds the extra information available about the error message in the exception. --- notmuch-new.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/notmuch-new.c b/notmuch-new.c index 3a60f7ca..16b4d022 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -291,8 +291,7 @@ add_file (notmuch_database_t *notmuch, const char *filename, case NOTMUCH_STATUS_READ_ONLY_DATABASE: case NOTMUCH_STATUS_XAPIAN_EXCEPTION: case NOTMUCH_STATUS_OUT_OF_MEMORY: - fprintf (stderr, "Error: %s. Halting processing.\n", - notmuch_status_to_string (status)); + (void) print_status_database("add_file", notmuch, status); goto DONE; default: INTERNAL_ERROR ("add_message returned unexpected value: %d", status); -- 2.13.2