From: Jani Nikula Date: Thu, 14 Nov 2013 14:13:41 +0000 (+0100) Subject: Re: [PATCH v2 2/5] compact: catch Xapian::Error consistently X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=59d2d9acee103c0d555aba0724c1beba179dc49f;p=notmuch-archives.git Re: [PATCH v2 2/5] compact: catch Xapian::Error consistently --- diff --git a/99/18b08a225b348a0922b0b0939df63a9ac36026 b/99/18b08a225b348a0922b0b0939df63a9ac36026 new file mode 100644 index 000000000..2a1b69641 --- /dev/null +++ b/99/18b08a225b348a0922b0b0939df63a9ac36026 @@ -0,0 +1,103 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 915F6429E25 + for ; Thu, 14 Nov 2013 06:14:10 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id QfpgTDleH9GQ for ; + Thu, 14 Nov 2013 06:14:05 -0800 (PST) +Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com + [74.125.82.48]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 1C5C3431FDC for ; Thu, 14 Nov 2013 06:14:04 -0800 + (PST) +Received: by mail-wg0-f48.google.com with SMTP id n12so1967626wgh.3 + for ; Thu, 14 Nov 2013 06:14:03 -0800 (PST) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:cc:subject:in-reply-to:references + :user-agent:date:message-id:mime-version:content-type; + bh=Zf/DXmwBKAo2Cu6z4wDz1kwNXRuYa3arwLwbIpLuH6o=; + b=iV4hWnTa/rH2UhS9SpGsfaKY7HTPbLNxwjrrm2iaa7b8fxPsAwzwi5F7jf5IDDeJ85 + QxyP9fbntE3cIzEtcZxbkr9KBYg0u7BuYsLqPq5n4wNfxcGK1+u3rHA5SEn7p0Pfqr/r + vGNiSoDRKWALgrA1WlhY85dlFU/mqwKaAoTnnYHF/jf+iuSBgW99/T9x6iZ6KUydOOak + 9cQiXZoTcEXdo1gNjmblBRACijhN8q2YI+3tQU/SKm6wTSadxRTpbBha4yJ3JhXzONgG + iCFmWQrYX/4pMrFjtN8sGHmNzNrvR0F8Nr79DuBfMDDC5vt4YJ0EyTsM2H0GZn3ihumE + ejbA== +X-Gm-Message-State: + ALoCoQnDS9n/ypaoKFciodRTiXY9mQGMSnu+yBFpQfLR8IyS1X/HC3k5RCMx50gDRWQXR4CbHer9 +X-Received: by 10.180.73.9 with SMTP id h9mr2925625wiv.26.1384438443675; + Thu, 14 Nov 2013 06:14:03 -0800 (PST) +Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3]) + by mx.google.com with ESMTPSA id c10sm861894wie.11.2013.11.14.06.13.59 + for + (version=TLSv1.1 cipher=RC4-SHA bits=128/128); + Thu, 14 Nov 2013 06:14:02 -0800 (PST) +From: Jani Nikula +To: Tomi Ollila , notmuch@notmuchmail.org +Subject: Re: [PATCH v2 2/5] compact: catch Xapian::Error consistently +In-Reply-To: <1384362167-12740-3-git-send-email-tomi.ollila@iki.fi> +References: <1384362167-12740-1-git-send-email-tomi.ollila@iki.fi> + <1384362167-12740-3-git-send-email-tomi.ollila@iki.fi> +User-Agent: Notmuch/0.16+115~gd647c65 (http://notmuchmail.org) Emacs/23.2.1 + (x86_64-pc-linux-gnu) +Date: Thu, 14 Nov 2013 15:13:41 +0100 +Message-ID: <87y54rm5pm.fsf@nikula.org> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Cc: tomi.ollila@iki.fi +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +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: Thu, 14 Nov 2013 14:14:10 -0000 + + +The first two patches LGTM. + +On Wed, 13 Nov 2013, Tomi Ollila wrote: +> catch Xapian::Error in compact code in lib/database.cc to be consistent +> with other code in addition to not making software crash on uncaught +> other Xapian error. +> --- +> lib/database.cc | 4 ++-- +> 1 file changed, 2 insertions(+), 2 deletions(-) +> +> diff --git a/lib/database.cc b/lib/database.cc +> index 3c008d6..3530cb6 100644 +> --- a/lib/database.cc +> +++ b/lib/database.cc +> @@ -918,8 +918,8 @@ notmuch_database_compact (const char *path, +> compactor.add_source (xapian_path); +> compactor.set_destdir (compact_xapian_path); +> compactor.compact (); +> - } catch (Xapian::InvalidArgumentError e) { +> - fprintf (stderr, "Error while compacting: %s\n", e.get_msg().c_str()); +> + } catch (const Xapian::Error &error) { +> + fprintf (stderr, "Error while compacting: %s\n", error.get_msg().c_str()); +> ret = NOTMUCH_STATUS_XAPIAN_EXCEPTION; +> goto DONE; +> } +> -- +> 1.8.3.1 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch