From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id +GfyERsz/l7WPgAA0tVLHw (envelope-from ) for ; Thu, 02 Jul 2020 19:18:51 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id EBnYDRsz/l7OQgAAB5/wlQ (envelope-from ) for ; Thu, 02 Jul 2020 19:18:51 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B53FA9400B9 for ; Thu, 2 Jul 2020 19:18:49 +0000 (UTC) Received: from [144.217.243.247] (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 1CBFE1F9AB; Thu, 2 Jul 2020 15:18:42 -0400 (EDT) Received: from che.mayfirst.org (unknown [162.247.75.117]) by mail.notmuchmail.org (Postfix) with ESMTPS id EB98C1F704 for ; Thu, 2 Jul 2020 15:18:38 -0400 (EDT) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019; t=1593717516; h=from : to : subject : in-reply-to : references : date : message-id : mime-version : content-type : from; bh=nl2TpMtWCJsdmqATxvITm3SqXjjLUifCIBzl7dVQPKY=; b=Oio9Znqit57ie/PTwZej1emlF9aWU0wetbhXoEvTRHpLsklpeMr+VIuvj22RpmthNnJch Nd0M3akcD7l0hvEBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1593717516; h=from : to : subject : in-reply-to : references : date : message-id : mime-version : content-type : from; bh=nl2TpMtWCJsdmqATxvITm3SqXjjLUifCIBzl7dVQPKY=; b=m5SFJFGkixI11V4TJ305/WjogMQT17ZxgfGt6QTlWOmPeAmCfqUEobEr3eEenqRdCYDXH p7LvEyvK9a1tEFm7F26nYALoQ9fcRM/kUxAPyViUbYbZMJ3Y8tSWyn4fERpnUQ0ei3M1U8g w8gQEhTkBoPmEXFeEuQPacyrMnaFvTg9p2Z3YYb/plystevjm8gjzKGdAQqt5j/QV/xD4JA w63dfjKIpZ6AzGfCoSfKGp8t+JwgFdOzNKpAKUEbAcYs/ArvBROkvN+9CZCF3lSgACvDXmV qFEZhRUUX6LZMrEQfR0/2FJwzzA7ro1BGfPfRIgMwUFK0OrxmojEd1g5ffBQ== Received: from fifthhorseman.net (tachanka.org [108.58.6.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by che.mayfirst.org (Postfix) with ESMTPSA id B5966F9A5; Thu, 2 Jul 2020 15:18:36 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 2AB1320297; Thu, 2 Jul 2020 15:16:52 -0400 (EDT) From: Daniel Kahn Gillmor To: David Bremner , notmuch@notmuchmail.org Subject: Re: introduce exception handling at top level of libnotmuch In-Reply-To: <20200630011411.612552-1-david@tethera.net> References: <20200630011411.612552-1-david@tethera.net> Autocrypt: addr=dkg@fifthhorseman.net; prefer-encrypt=mutual; keydata= mDMEXEK/AhYJKwYBBAHaRw8BAQdAr/gSROcn+6m8ijTN0DV9AahoHGafy52RRkhCZVwxhEe0K0Rh bmllbCBLYWhuIEdpbGxtb3IgPGRrZ0BmaWZ0aGhvcnNlbWFuLm5ldD6ImQQTFggAQQIbAQULCQgH AgYVCgkICwIEFgIDAQIeAQIXgAIZARYhBMS8Lds4zOlkhevpwvIGkReQOOXGBQJd5Hw3BQkFpJWB AAoJEPIGkReQOOXGDYEA/j0ERjPxDleKMZ2LDcWc/3o5cLFwAVzBKQHppu0Be5IWAP0aeTnyEqlp RTE7M8zugwkhYeUYfYu0BjecDUMnYz6iDLgzBF3kewUWCSsGAQQB2kcPAQEHQK1IuW0GZmcrs2mx CYMl8IHse0tMF8cP7eBNXevrlx2ZiPUEGBYIACYCGwIWIQTEvC3bOMzpZIXr6cLyBpEXkDjlxgUC XeR7TwUJAiGl/gCBdiAEGRYIAB0WIQQsv6x2UaqQJzY+dXHEDyVUMvKBDwUCXeR7BQAKCRDEDyVU MvKBD7KmAQCHs+7588C4jto6fMje0Nu97zzoppjJM7lrGF2rVnbHvwD+MgmGUbHzPSUrTWnZBQDi /QM595bxNrBA4N1CiXhs2AMJEPIGkReQOOXGpp0BAM7YeBnt/UNvxJAGm4DidSfHU7RDMWe6Tgux HrH21cDkAQC9leNFXJsQ7F2ZniRPHa8CkictcQEKPL8VCWpfe8LbArg4BF3ke5wSCisGAQQBl1UB BQEBB0Cf+EiAXtntQMf51xpqb6uZ5O0eCLAZtkg0SXHjA1JlEwMBCAeIfgQYFggAJhYhBMS8Lds4 zOlkhevpwvIGkReQOOXGBQJd5HucAhsMBQkCIaVkAAoJEPIGkReQOOXGdYcBANYnW7VyL2CncKH1 iO4Zr0IwfdIv6rai1PUHL98pVi3cAP9tMh85CKGDa0Xi/fptQH41meollLW5tLb/bEWMuUNuBQ== Date: Thu, 02 Jul 2020 15:16:51 -0400 Message-ID: <87tuypu3q4.fsf@fifthhorseman.net> MIME-Version: 1.0 Message-ID-Hash: MN3ZRSKJM5BQQO3PUHMRIHZ6HJW52UPU X-Message-ID-Hash: MN3ZRSKJM5BQQO3PUHMRIHZ6HJW52UPU X-MailFrom: dkg@fifthhorseman.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: multipart/mixed; boundary="===============6834797630616968832==" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=fifthhorseman.net header.s=2019 header.b=Oio9Znqi; dkim=fail (body hash did not verify) header.d=fifthhorseman.net header.s=2019rsa header.b=m5SFJFGk; dmarc=fail reason="SPF not aligned (relaxed)" header.from=fifthhorseman.net (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: -1.97 X-TUID: S9CRKCcQyi4I --===============6834797630616968832== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Hi Bremner, all-- On Mon 2020-06-29 22:14:07 -0300, David Bremner wrote: > I know that some of you are not C++ fans, but at the moment this is > the cleanest fix I can think of to uncaught xapian exceptions causing > calls to the library to die. Floris reminded me of this recently with > the discussion about operations on closed databases, but cleaning up > the handling of exceptions in libnotmuch has been on my mind for a > while. It will be bit laborious so I did a few functions for > discussion purposes before getting too carried away. I've read through the series and it looks reasonable to me. I've also tested them, and they behave as expected. If someone has a more nuanced approach to dealing with some of the subtle exceptions that might be raised, i'd be happy to see those approaches laid on top of this series. > There is still a certain amount of boilerplate with more or less > identical try/catch blocks (yes, I really miss scheme macros here). I > could mostly eliminate that with C++11 lambdas, but I wasn't sure the > result was more maintainable or nicer. I think this looks fine, and it isn't a huge amount of boilerplate. Please merge. --dkg --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQQsv6x2UaqQJzY+dXHEDyVUMvKBDwUCXv4yowAKCRDEDyVUMvKB D5zsAP9Kwq3QS3dgLGCQKHiozkLaPOdifcO7bat16YnadsDLRgEAiG/3+sBE6Ed3 ExSXTNqN7vsB8VKEDhap+QwHs31dtAg= =LjJ9 -----END PGP SIGNATURE----- --=-=-=-- --===============6834797630616968832== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-leave@notmuchmail.org --===============6834797630616968832==--