From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jens Schmidt Newsgroups: gmane.emacs.devel Subject: Re: Attaching context info to an error Date: Fri, 22 Dec 2023 21:56:32 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40032"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 22 21:57:55 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rGmag-000AC9-Vo for ged-emacs-devel@m.gmane-mx.org; Fri, 22 Dec 2023 21:57:55 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rGmZs-0005Om-SE; Fri, 22 Dec 2023 15:57:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGmZp-0005OZ-4D for emacs-devel@gnu.org; Fri, 22 Dec 2023 15:57:01 -0500 Original-Received: from mr3.vodafonemail.de ([145.253.228.163]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGmZj-0001xc-D3 for emacs-devel@gnu.org; Fri, 22 Dec 2023 15:56:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de; s=vfde-mb-mr2-23sep; t=1703278608; bh=pKGQtosWRUTUNXZ1MBnEMMJWpGmom2f/UmzAD5I791c=; h=Message-ID:Date:User-Agent:Subject:To:References:From: Content-Language:In-Reply-To:Content-Type:From; b=h5t3R6nkWWcb/Wk2rL9/K2Rse0Y+vuco+AYQPXzsfgzycDNBxfJMLRHlleeBG5OLo UreMBU2rbBYEgZcep8Slf4VWJcuRPU8gm+qpf+CYwiQNbk//hHMSNYK+xXHWffI97y qVYO9lenhkEFWES8Z8m+S2+grxsLC5GVLwnjCIpo= Original-Received: from smtp.vodafone.de (unknown [10.0.0.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mr3.vodafonemail.de (Postfix) with ESMTPS id 4Sxfjr2GZyz1yk2; Fri, 22 Dec 2023 20:56:48 +0000 (UTC) Original-Received: from [192.168.178.41] (port-92-196-103-231.dynamic.as20676.net [92.196.103.231]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id 4Sxfjj09fvzMks9; Fri, 22 Dec 2023 20:56:37 +0000 (UTC) Content-Language: de-DE-frami, en-US In-Reply-To: X-purgate-type: clean X-purgate: clean X-purgate-size: 880 X-purgate-ID: 155817::1703278604-F5FFA24F-4B99A3AA/0/0 Received-SPF: pass client-ip=145.253.228.163; envelope-from=jschmidt4gnu@vodafonemail.de; helo=mr3.vodafonemail.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:314085 Archived-At: I might lack experience here, but I give it a try, anyway ... On 2023-12-21 23:30, Stefan Monnier wrote: > I'm playing with `handler-bind` and trying to see how we could make use > of such a functionality in Emacs. `handler-bind' seems to have the main advantage over `condition-case' that you get the full information about the original error stack, while in a `condition-case' that information is lost, correct? > [...] > > but I don't like the idea of changing one kind of error into another. Why not? Wrapping errors that way is what I know. > Any other idea how/where we could attach that info? Property list of the error-symbol? Not beautiful, but probably more stable than "external" storage as in a hash table. Probably too stable in the sense that the property list (without further provisions) would survive the lifetime of the error.