From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iFlxB43uqmC5EAAAgWs5BA (envelope-from ) for ; Mon, 24 May 2021 02:08:45 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 4KgtA43uqmCHTgAAB5/wlQ (envelope-from ) for ; Mon, 24 May 2021 00:08:45 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CAA2013B8F for ; Mon, 24 May 2021 02:08:44 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 28FD42AB22; Sun, 23 May 2021 20:08:41 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id EE69B20017 for ; Sun, 23 May 2021 20:08:38 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id CE8425FD25; Sun, 23 May 2021 20:08:38 -0400 (EDT) Received: (nullmailer pid 2660922 invoked by uid 1000); Mon, 24 May 2021 00:08:37 -0000 From: David Bremner To: notmuch@notmuchmail.org Cc: David Bremner Subject: [PATCH 2/2] lib/message: use passed database for error handling Date: Sun, 23 May 2021 21:08:29 -0300 Message-Id: <20210524000829.2660860-2-david@tethera.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210524000829.2660860-1-david@tethera.net> References: <20210524000829.2660860-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: TKORC7RYWEUCZEQBV45YGC3XDLYCNYMT X-Message-ID-Hash: TKORC7RYWEUCZEQBV45YGC3XDLYCNYMT X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621814924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=7aj6JQzFqMh57Pc8lfaDgnsQ36Xo7wTCOF8v/pdvo+s=; b=KPsnkTVMKd9YfIms1raWx90kR5gjMfoiIwbnbkVLWXFHpOkA8Sl/XozlxbZ/lcrDjEQ/VD 83+zS8S0eHn273TKq9i7EsOHGxyRVraYRkcgin6S0hn/zy9lS8uQub3FFS9ZMaDEI6xuo0 dKJHf4Wmfxcof1wfK/+rCyVTQnrd5gjXGBDI791dQTbUgzBrCBjsqkaTkBPi3jv7g3IDAO hPHoiM8wTFgom5vetN8XF4YTgZ1eipwIrkA3MvjR75eHScupAfpQY8J+TCgsUH4xBRBnUg 1QaCJ1LBNSehb3Id5gjrhV/7S6CneiJzUX5OqlocuN4DkVuAG0GAxzRXYcZnHw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621814924; a=rsa-sha256; cv=none; b=b8vXDhr+afe/wCT5nLM3ORrN6GoophBdUyqxEf5tA3x4Z4U6Ki/43DVt0PMnxV+DrV+Rjx srmtkKZIPtlDNly6Jjk2pBkD6WGFFap4N72NJWMuqRrxwCNBieRgFm0e9T86uMMD9FMo96 jRocd5sStJCyV8MMSWsrPN/oY61YgFuF1+zy0D74O7sKInBa0F2OjSeJfUKLJOcqJnCA2K ElOHO35bsR3HXq8i7r5hW5nx0uGhJpcp7bJJtjILCmOxvmbpPujQZpxzu+98WS+DcIKt/B 7uKfrR2lMomnp+YuQQJXrwzHR88HXSxGmoHd5DF+siLLHEugDqSMoXQqiSLTRQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.07 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: CAA2013B8F X-Spam-Score: -1.07 X-Migadu-Scanner: scn0.migadu.com X-TUID: Phs68AoT0Vnd 'message' should always be initialized if we reach here, but in case it is not, we still want to be able to log an error message. --- lib/message.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/message.cc b/lib/message.cc index 7af6ab82..8a67e2a5 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -288,7 +288,7 @@ _notmuch_message_create_for_message_id (notmuch_database_t *notmuch, doc_id = _notmuch_database_generate_doc_id (notmuch); } catch (const Xapian::Error &error) { - _notmuch_database_log (notmuch_message_get_database (message), + _notmuch_database_log (notmuch, "A Xapian exception occurred creating message: %s\n", error.get_msg ().c_str ()); notmuch->exception_reported = true; -- 2.30.2