From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 19 17:33:11 2020 Received: (at submit) by debbugs.gnu.org; 19 Jun 2020 21:33:11 +0000 Received: from localhost ([127.0.0.1]:56970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmOdL-0007tW-Ia for submit@debbugs.gnu.org; Fri, 19 Jun 2020 17:33:11 -0400 Received: from lists.gnu.org ([209.51.188.17]:42948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmOdH-0007tM-DT for submit@debbugs.gnu.org; Fri, 19 Jun 2020 17:33:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmOdH-0006s9-5z for bug-guile@gnu.org; Fri, 19 Jun 2020 17:33:07 -0400 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]:43958) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jmOdF-0007lr-Gs for bug-guile@gnu.org; Fri, 19 Jun 2020 17:33:06 -0400 Received: by mail-qv1-xf44.google.com with SMTP id dp10so5159289qvb.10 for ; Fri, 19 Jun 2020 14:33:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=1V/1WYzzNT3K6htb9CHbzxFZ+WBKiXSm9axPmCryHKY=; b=Brdj+M7jMtrc7nhwOJjte8DUGCvmD5jN0fl48UM7iw4UlLFgxTlOyNYQ4OB3Rqn7cR IYlwzRK7v0nmtzyuLWm/bLlanm8NJe7MvsGyQiljLkAqg0xyrfhEaTFODOvKCdKOF0hB 8dgI5X//VKzxdjAytrH+WuALjSEM14hgmf9ErQhMs9rMxjZTiRAA9NFZdwPN8/PSObai zovcB0QvlSisKVBLsI31rim+YG+/9Xu66glXhNMpCDMRXhX2MGuEBjXBLymtNREJayJZ x8kXyL5SPIFlhn1zNumGTzPbqM4aDIsCYahYZL6H8g1Bbp1dFXIJLclXA5BGLQVEIKP0 2h/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=1V/1WYzzNT3K6htb9CHbzxFZ+WBKiXSm9axPmCryHKY=; b=bME2LabQExPeIy5DSl5iDCO4fK8yG1f+gXrWRsrje8SX0Hcigl59ggR+rReKUlHY36 7LJPpCxsgukRcQ+YIaQBiAbLnDt8WhMvzM+0+ADu5oI8ksOa1Z1E9IUdpzl58IWD80iV a9UjPsNUr9z0vBdCIgmU8guMgpn+TFjRQA5k6s4yevcQIHLpVRkXr/8js+AfM+guVKfO /igOQxAoHHUne54Iynaxh0OIUk/XoIN1637MFnayXM6mT6D3MuF5fL+aIG749sgm4QS0 nt+T/5lyiTt1C8sI9b6SkeNBcjSrEqB5aIGczY0+wrd6b0tHUUlECbdIJRiUAHQTK8Q0 3sJg== X-Gm-Message-State: AOAM5333ZRN2vaZgd/ehxcuzuyW/tuRpaAxMNNuv4yBF5XpSJnU9AASp IGJEH2jrkv10qaVyB98KajOsCmMTBtAc7g== X-Google-Smtp-Source: ABdhPJwlunDQzZ6QYgksITBPncm7cNQfNx+tADhU/2+qq+SZBgN7pUCPwS1waHlqAek93zczzr6ScA== X-Received: by 2002:a05:6214:594:: with SMTP id bx20mr10716586qvb.131.1592602384296; Fri, 19 Jun 2020 14:33:04 -0700 (PDT) Received: from hurd (dsl-158-72.b2b2c.ca. [66.158.158.72]) by smtp.gmail.com with ESMTPSA id n126sm7025129qke.15.2020.06.19.14.33.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2020 14:33:03 -0700 (PDT) From: Maxim Cournoyer To: bug-guile@gnu.org Subject: [PATCH] ice-9: exceptions: Properly format the error message. Date: Fri, 19 Jun 2020 17:33:02 -0400 Message-ID: <87eeqad9m9.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::f44; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qv1-xf44.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain Hello, I had this problem in Guix where 'guix deploy my-config.scm' would unhelpfully report an error like: guix deploy: error: failed to deploy my-host: ~A: ~S Digging a bit, I could reproduce at the REPL with: --8<---------------cut here---------------start------------->8--- (guard (c ((message-condition? c) (format #t "error: ~a~%" (condition-message c)))) ;; This is what (canonicalize-path "/do/not/exist) ends up doing: (throw 'system-error "canonicalize-path" "~A" '("No such file or directory"))) --> error: ~A --8<---------------cut here---------------end--------------->8--- It seems our native -> srfi-34 style exception converter should populate the message field with a formatted message, given that's what happens to present errors as explained in libguile/error.c: When an error is reported,\n "these are replaced by formatting the corresponding members of\n" "@var{args}: @code{~A} (was @code{%s} in older versions of\n" "Guile) formats using @code{display} and @code{~S} I'm not sure about the second ~S that appeared in the Guix output; possibly the exception got re-thrown and suffered from a slightly different conversion problem? Anyway, the simple patch attached should fix the "~A" exception message. Thank you, Maxim --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-ice-9-exceptions-Properly-format-the-error-message.patch >From adaa2f66fec7684e9e65491158afc5923613e3da Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 19 Jun 2020 14:30:05 -0400 Subject: [PATCH] ice-9: exceptions: Properly format the error message. Before this change, native exceptions such as system errors caught with srfi-34's `guard' would be converted to an exception with its message unhelpfully set to "~A". Thus, apply the message arguments to the message format to derive a human readable exception message. * module/ice-9/exceptions.scm (guile-common-exceptions): Format the message string using its arguments. --- module/ice-9/exceptions.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/ice-9/exceptions.scm b/module/ice-9/exceptions.scm index 143e7aa3e..c990790e9 100644 --- a/module/ice-9/exceptions.scm +++ b/module/ice-9/exceptions.scm @@ -189,7 +189,7 @@ ((subr msg margs . _) (make-exception (make-exception-with-origin subr) - (make-exception-with-message msg) + (make-exception-with-message (apply format #f msg margs)) (make-exception-with-irritants margs))) (_ (make-exception-with-irritants args))) args)) -- 2.26.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 20 01:46:23 2020 Received: (at 41956) by debbugs.gnu.org; 20 Jun 2020 05:46:23 +0000 Received: from localhost ([127.0.0.1]:57155 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmWKd-0002w6-B0 for submit@debbugs.gnu.org; Sat, 20 Jun 2020 01:46:23 -0400 Received: from mail-qv1-f65.google.com ([209.85.219.65]:39299) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmWKb-0002vr-F5 for 41956@debbugs.gnu.org; Sat, 20 Jun 2020 01:46:21 -0400 Received: by mail-qv1-f65.google.com with SMTP id r16so5550525qvm.6 for <41956@debbugs.gnu.org>; Fri, 19 Jun 2020 22:46:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=FGbFaZcR4kkuglyPqa/oG4tOeVZyjoZUinIPFsbCDWc=; b=RRZcwDF5AA035s0J4WCCxrr8p+/PEsTQKo3V0G3buv1AFXn/R3SnxRT/qMwc4iEMfX 6ywTdE0WWRVS0KTMHMaauaGI4h7YU5CmxDvbesmDRlOxYdjm347jAs0nfYnHxCdJ4pGt hDG3Lea4i9KDkWoL3m/lzb0y/iqOh+no/KAXt/jIIGXuxBOFCMNyygj4zq2tsW1mrd6B SFV/Fu1CnaUJ+6hXhP4YyTvAelrczsAzDVonjLdtrsv7qoybFMd8YY3lY6U9kugfaJz8 Ar4PO6QtfqqlAKzTAX5s+ESEOkldqEZSOkoyQAmeNj2Z5qRvSfOOkf+oGvNR29AmO1tr vo9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=FGbFaZcR4kkuglyPqa/oG4tOeVZyjoZUinIPFsbCDWc=; b=MGnO3Mo62m38uc3tX0zcWWeecFKaoQnHKUizH0sgMTcoY6RAlyHDf94FKAr4egChoc nh4xFzrESYgyaUTHqOMGkbBhJsax2x7vx910PCP/hOeYFAv1im8KXYmMx9RIj0FUMlRK DxMXM0mndzlSqZS/K3vsGiL9s8KV8slub0vcMkzk06oJ6SbcGHy0iDvz3EaOYvZFrGw+ SAhL2E5eP0JIjtY0RxDJy453VZuxasHSpITSoBlul44/JL6Ad+FWE3Vn9ogmMy+5wT51 50N2ifptG+COoVRBmhYhn6MnzBMPu5Oc+PQ+eAloVV4wrMq+0KcBhrWFPvzQra1/ppGs qugA== X-Gm-Message-State: AOAM530FPp0sBRM0WYDJcRSKhPAtC7TNfCArD00e87cy0oht+fnL3jxG ozNN2YHMeU5zp6QhxVJEzVZKCGtcnnE= X-Google-Smtp-Source: ABdhPJyy5EQTW94GYFdPkc2A5RrvTtsmoW41ver5OdRyaSKMpbHzU4HFHBi0qvjPsygRP267Ip6cnw== X-Received: by 2002:a05:6214:a8a:: with SMTP id ev10mr11815617qvb.191.1592631975625; Fri, 19 Jun 2020 22:46:15 -0700 (PDT) Received: from hurd (dsl-158-72.b2b2c.ca. [66.158.158.72]) by smtp.gmail.com with ESMTPSA id z77sm8996301qka.59.2020.06.19.22.46.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2020 22:46:15 -0700 (PDT) From: maxim.cournoyer@gmail.com X-Google-Original-From: maxim@hurd.i-did-not-set--mail-host-address--so-tickle-me To: Maxim Cournoyer Subject: Re: bug#41956: [PATCH] ice-9: exceptions: Properly format the error message. References: <87eeqad9m9.fsf@gmail.com> Date: Sat, 20 Jun 2020 01:46:13 -0400 In-Reply-To: <87eeqad9m9.fsf@gmail.com> (Maxim Cournoyer's message of "Fri, 19 Jun 2020 17:33:02 -0400") Message-ID: <87wo42mgre.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 41956 Cc: 41956@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Maxim Cournoyer writes: > Hello, > > I had this problem in Guix where 'guix deploy my-config.scm' would > unhelpfully report an error like: > > guix deploy: error: failed to deploy my-host: ~A: ~S > > Digging a bit, I could reproduce at the REPL with: > > (guard (c ((message-condition? c) > (format #t "error: ~a~%" (condition-message c)))) > ;; This is what (canonicalize-path "/do/not/exist) ends up doing: > (throw 'system-error "canonicalize-path" "~A" '("No such file or directory"))) > > --> error: ~A [...] Unfortunately the previous patch breaks the tests, with errors like: ERROR: bytevectors.test: Datum Syntax: incorrect prefix - arguments: ((wrong-type-arg "apply" "Apply to non-list: ~S" (#\i) (#\i))) I'm out of ideas for now, I last tried: --8<---------------cut here---------------start------------->8--- modified module/ice-9/exceptions.scm @@ -189,7 +189,10 @@ ((subr msg margs . _) (make-exception (make-exception-with-origin subr) - (make-exception-with-message msg) + (let ((msg (if (null? margs) + msg + (apply simple-format #f msg margs)))) + (make-exception-with-message msg)) (make-exception-with-irritants margs))) (_ (make-exception-with-irritants args))) args)) --8<---------------cut here---------------end--------------->8--- To the same effect. Maxim From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 20 14:33:56 2020 Received: (at 41956) by debbugs.gnu.org; 20 Jun 2020 18:33:56 +0000 Received: from localhost ([127.0.0.1]:58757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmiJQ-0000iu-Lh for submit@debbugs.gnu.org; Sat, 20 Jun 2020 14:33:56 -0400 Received: from imta-35.everyone.net ([216.200.145.35]:33758 helo=imta-38.everyone.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmiJN-0000il-Tw for 41956@debbugs.gnu.org; Sat, 20 Jun 2020 14:33:55 -0400 Received: from pps.filterd (m0004961.ppops.net [127.0.0.1]) by imta-38.everyone.net (8.16.0.27/8.16.0.27) with SMTP id 05KIUnAJ005319; Sat, 20 Jun 2020 11:33:52 -0700 X-Eon-Originating-Account: dN7Sj42iHeQjTvbHZAru04yKIdV_EfdE3cBmqTUi6tQ X-Eon-Dm: m0116953.ppops.net Received: by m0116953.mta.everyone.net (EON-AUTHRELAY2 - 53b929fa) id m0116953.5e67f935.a4f613; Sat, 20 Jun 2020 11:33:45 -0700 X-Eon-Sig: AQMHrIJe7laJkBUHCgIAAAAC,c46d252d112cb0a24d703bd8589b8758 X-Eip: EYamEFO_AKEDKjgywAcvaU6D1pRNJPzX-GWLaNG6LPQ Date: Sat, 20 Jun 2020 20:33:34 +0200 From: Bengt Richter To: maxim.cournoyer@gmail.com Subject: Re: bug#41956: [PATCH] ice-9: exceptions: Properly format the error message. Message-ID: <20200620183334.GA9490@LionPure> References: <87eeqad9m9.fsf@gmail.com> <87wo42mgre.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87wo42mgre.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> User-Agent: Mutt/1.10.1 (2018-07-13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-20_09:2020-06-19, 2020-06-20 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2004280000 definitions=main-2006200136 X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 41956 Cc: 41956@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Bengt Richter Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) Hi Maxim, tl;dr: Does module/ice-9/exceptions.scm use the default format? Maybe (use-modules (ice-9) format) will help get to the next bug ?? :) On +2020-06-20 01:46:13 -0400, maxim.cournoyer@gmail.com wrote: > Maxim Cournoyer writes: > > > Hello, > > > > I had this problem in Guix where 'guix deploy my-config.scm' would > > unhelpfully report an error like: > > > > guix deploy: error: failed to deploy my-host: ~A: ~S > > > > Digging a bit, I could reproduce at the REPL with: > > > > (guard (c ((message-condition? c) > > (format #t "error: ~a~%" (condition-message c)))) > > ;; This is what (canonicalize-path "/do/not/exist) ends up doing: > > (throw 'system-error "canonicalize-path" "~A" '("No such file or directory"))) > > > > --> error: ~A > > [...] > > Unfortunately the previous patch breaks the tests, with errors like: > > ERROR: bytevectors.test: Datum Syntax: incorrect prefix - arguments: ((wrong-type-arg "apply" "Apply to non-list: ~S" (#\i) (#\i))) > > I'm out of ideas for now, I last tried: > > --8<---------------cut here---------------start------------->8--- > modified module/ice-9/exceptions.scm > @@ -189,7 +189,10 @@ > ((subr msg margs . _) > (make-exception > (make-exception-with-origin subr) > - (make-exception-with-message msg) > + (let ((msg (if (null? margs) > + msg > + (apply simple-format #f msg margs)))) > + (make-exception-with-message msg)) > (make-exception-with-irritants margs))) > (_ (make-exception-with-irritants args))) > args)) > --8<---------------cut here---------------end--------------->8--- > > To the same effect. > > Maxim > > > HTH -- Regards, Bengt Richter From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 20 23:49:37 2020 Received: (at 41956) by debbugs.gnu.org; 21 Jun 2020 03:49:37 +0000 Received: from localhost ([127.0.0.1]:59085 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmqzB-0007yj-4w for submit@debbugs.gnu.org; Sat, 20 Jun 2020 23:49:37 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:43554) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmqz8-0007yV-TR for 41956@debbugs.gnu.org; Sat, 20 Jun 2020 23:49:35 -0400 Received: by mail-qt1-f196.google.com with SMTP id v19so7819726qtq.10 for <41956@debbugs.gnu.org>; Sat, 20 Jun 2020 20:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=MPBFFEo9cUdVuBTeFYHfWeG9dzE3FT4f1TYRSKho4DI=; b=DkPKHsr+AIbQABaehI0tqs1OZ4Mu0fD3Ng9Sw54r2sVww1q4/AGmteAwM2pD2QAE7T lTnvbRJA99sAzOnFS+TgOFrKzXib1THrvzs53+K2L3zkznQk2/MtGruLIKayEAa08EyS 5wnvxl2XC1405eUOviqlLZR8XlY65jmpu3592BapslHyxQCY/5B2q0H69IBoZXSdawx1 +1OP2Zwu0dI+cYfYH2J2h+WcKMbXq3X2yHTE60zf+JWFuepDoRMknkKfs+iBaqI5Rtzx snXi9vSFT251sbiKTXPdosI2h7WHnUW7TjyYAxoRYS3WHC8tfmIwdqnjUascODwNzzgm 9t6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=MPBFFEo9cUdVuBTeFYHfWeG9dzE3FT4f1TYRSKho4DI=; b=cr2eL58DEMlXHv6FjgD8Utns/Wsx7BjQDLx80KEn62dnmBTZ/Z/zYxRgEtF4sammgR R178NQrLjqSeX/l213CFdOxd9ncmqoD+vO0pzqUw1Yg7Tgzy0dkaaukM1ThNktHFRUXP e5kfLDZLHL/vfHyZNV0HzgZZ1LGBeRZNBHexfM+zoO7XM0BASkHSOF+8MfSOwHHTm67d w8a+m4+D3n5vwylxdY2ZuS5TCOmvXATRUeA86k6H172uz4LfmhOXgC6N6Dca/5ieEm6h ZZW6SEHSV6k72xweg7qj8zpDD0AehbU2WSqHI7KoeQZZhjo+1D2Q420q6t6Tr8OeyjW/ Mtog== X-Gm-Message-State: AOAM533087jnfe2ofxqIWOUryhDwiNb6EUMgsUUkBYQ9hJKHMZdaj/Rh PYgUePk+1yq/5fcFvz2eH7FMcZigYzs= X-Google-Smtp-Source: ABdhPJyoKSie/xpV/f1og0ifjAErsDhQh9RoSVrpDY2b6qLVallgRpDVI/bTztAyf6oZgkLU8qpruA== X-Received: by 2002:ac8:479a:: with SMTP id k26mr11315221qtq.264.1592711369083; Sat, 20 Jun 2020 20:49:29 -0700 (PDT) Received: from hurd (dsl-158-72.b2b2c.ca. [66.158.158.72]) by smtp.gmail.com with ESMTPSA id 60sm10558634qth.78.2020.06.20.20.49.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Jun 2020 20:49:28 -0700 (PDT) From: Maxim Cournoyer To: Bengt Richter Subject: Re: bug#41956: [PATCH] ice-9: exceptions: Properly format the error message. References: <87eeqad9m9.fsf@gmail.com> <87wo42mgre.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> <20200620183334.GA9490@LionPure> Date: Sat, 20 Jun 2020 23:49:19 -0400 In-Reply-To: <20200620183334.GA9490@LionPure> (Bengt Richter's message of "Sat, 20 Jun 2020 20:33:34 +0200") Message-ID: <87r1u9m62o.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 41956 Cc: 41956@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Bengt! Bengt Richter writes: > Hi Maxim, > > tl;dr: > Does module/ice-9/exceptions.scm use the default format? > Maybe (use-modules (ice-9) format) will help get to the next bug ?? :) Thanks for suggesting! I tried but got the same result. I'm now testing a slightly different version: @@ -189,7 +189,10 @@ ((subr msg margs . _) (make-exception (make-exception-with-origin subr) - (make-exception-with-message msg) + (let ((msg (if (list? margs) + (apply simple-format #f msg margs) + msg))) + (make-exception-with-message msg)) (make-exception-with-irritants margs))) (_ (make-exception-with-irritants args))) args)) Maxim From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 25 06:04:43 2020 Received: (at 41956) by debbugs.gnu.org; 25 Jun 2020 10:04:43 +0000 Received: from localhost ([127.0.0.1]:39717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1joOkM-0001d9-QD for submit@debbugs.gnu.org; Thu, 25 Jun 2020 06:04:43 -0400 Received: from sender4-of-o53.zoho.com ([136.143.188.53]:21370) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1joOkI-0001cx-JK for 41956@debbugs.gnu.org; Thu, 25 Jun 2020 06:04:41 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1593079475; cv=none; d=zohomail.com; s=zohoarc; b=GbuLxxiNJU5iBGKnHuFosiqADgCh8wpgj7nGIat6Znt+SdjneRWy23i6/z2gMpbArF9xYiuAF0YZ/7wHth8LPaylmxdHOCQEqtcvNjipSWX83XGLarVtjz3l8AMzZ37jbPG6d0r6TEmjjfq3qLfevHuhplKVlwIQgObSp22V91o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593079475; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=Xqv4o5R0a8fK15/+KmnvygMsgnbcismlPD4tG+GMU7I=; b=jl/RnR/3Lta11qNx4wvIRPTSeHp6NUZ0nVZdzlh1apsOgmvD6F/t51BSuBVnLV8u+yPjIteScD6oLvUlDPxsCtLEbvnjt/YiVrUUYTQPsd1Sxs3ZvQ0dUpsRdHgcVBqdviHk50hdxA0cuM8Sw0B6zXydjH98ayU2ngzXWTfK5SQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1593079475; s=zoho; d=elephly.net; i=rekado@elephly.net; h=References:From:To:Cc:Subject:In-reply-to:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=Xqv4o5R0a8fK15/+KmnvygMsgnbcismlPD4tG+GMU7I=; b=DhqBgNdvhelrf4EWI6o1aDq4uDVCGx8afJv70Sos031CJDR3+c96mYOGQevdNeG5 5+OIq5c54c0Blkse+CEqUqpJw7lfw3R5QspWNNYO0EOcp30pRXtWYTNQL7/sqFFz3sA 387W8MzBYbFvR6ygz9W3fG79AgtjmOd4SVs6rZ7s= Received: from localhost (p54ad4b85.dip0.t-ipconnect.de [84.173.75.133]) by mx.zohomail.com with SMTPS id 1593079471457234.82363824088588; Thu, 25 Jun 2020 03:04:31 -0700 (PDT) References: <87eeqad9m9.fsf@gmail.com> <87wo42mgre.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> <20200620183334.GA9490@LionPure> <87r1u9m62o.fsf@gmail.com> User-agent: mu4e 1.4.10; emacs 26.3 From: Ricardo Wurmus To: Maxim Cournoyer Subject: Re: bug#41956: [PATCH] ice-9: exceptions: Properly format the error message. In-reply-to: <87r1u9m62o.fsf@gmail.com> X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Date: Thu, 25 Jun 2020 12:04:27 +0200 Message-ID: <87bll7qx5g.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 41956 Cc: 41956@debbugs.gnu.org, Bengt Richter X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Maxim, here=E2=80=99s what I did in the REPL: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> ,m (ice-9 exceptions) scheme@(ice-9 exceptions)> (define (my/guile-system-error-converter key arg= s) (apply (case-lambda ((subr msg-args msg errno . rest) ;; XXX TODO we should return a more specific error ;; (usually an I/O error) as expected by R6RS programs. ;; Unfortunately this often requires the 'filename' (or ;; other?) which is not currently provided by the native ;; Guile exceptions. (make-exception (make-external-error) (make-exception-with-origin subr) (apply make-exception-with-message msg) (make-exception-with-irritants msg-args))) (_ (guile-external-error-converter key args))) args)) scheme@(ice-9 exceptions)> (set! guile-exception-converters (acons 'system-= error my/guile-system-error-converter guile-exception-converters)) scheme@(ice-9 exceptions)> ,m (guile-user) scheme@(guile-user)> (guard (c ((message-condition? c) (format #t "message: ~a~%" (condition-message c)))) (canonicalize-path "/doesntexist")) message: No such file or directory $11 =3D #t scheme@(guile-user)>=20 --8<---------------cut here---------------end--------------->8--- --=20 Ricardo From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 25 12:34:06 2020 Received: (at 41956) by debbugs.gnu.org; 25 Jun 2020 16:34:06 +0000 Received: from localhost ([127.0.0.1]:40994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1joUpB-0003VV-Ta for submit@debbugs.gnu.org; Thu, 25 Jun 2020 12:34:06 -0400 Received: from imta-38.everyone.net ([216.200.145.38]:57392) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1joUpA-0003VN-6w for 41956@debbugs.gnu.org; Thu, 25 Jun 2020 12:34:04 -0400 Received: from pps.filterd (omta003.sj2.proofpoint.com [127.0.0.1]) by imta-38.everyone.net (8.16.0.27/8.16.0.27) with SMTP id 05PGPGjK028342; Thu, 25 Jun 2020 09:34:02 -0700 X-Eon-Originating-Account: Nb8qXJ-a_WuxPfaGwzA-bTdHjw2r4YQKGUL8xz9HhFE X-Eon-Dm: m0116953.ppops.net Received: by m0116953.mta.everyone.net (EON-AUTHRELAY2 - 5a81d29d) id m0116953.5ef25221.3a04d; Thu, 25 Jun 2020 09:33:51 -0700 X-Eon-Sig: AQMHrIJe9NHvUVsXjQIAAAAD,b1bf74c4975ecd004bfa194511b5e8a9 X-Eip: wyZLLpXTz6TeNKWPMjqp1zcjrVN3pe8e8RkS9p4qkCo Date: Thu, 25 Jun 2020 18:33:41 +0200 From: Bengt Richter To: Ricardo Wurmus Subject: Re: bug#41956: [PATCH] ice-9: exceptions: Properly format the error message. Message-ID: <20200625163341.GA4622@LionPure> References: <87eeqad9m9.fsf@gmail.com> <87wo42mgre.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> <20200620183334.GA9490@LionPure> <87r1u9m62o.fsf@gmail.com> <87bll7qx5g.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87bll7qx5g.fsf@elephly.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-25_11:2020-06-25, 2020-06-25 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2004280000 definitions=main-2006250103 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41956 Cc: 41956@debbugs.gnu.org, Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Bengt Richter Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Ricardo et al, On +2020-06-25 12:04:27 +0200, Ricardo Wurmus wrote: > > Hi Maxim, > > here’s what I did in the REPL: > > --8<---------------cut here---------------start------------->8--- > scheme@(guile-user)> ,m (ice-9 exceptions) > scheme@(ice-9 exceptions)> (define (my/guile-system-error-converter key args) > (apply (case-lambda > ((subr msg-args msg errno . rest) > ;; XXX TODO we should return a more specific error > ;; (usually an I/O error) as expected by R6RS programs. > ;; Unfortunately this often requires the 'filename' (or > ;; other?) which is not currently provided by the native > ;; Guile exceptions. > (make-exception > (make-external-error) > (make-exception-with-origin subr) > (apply make-exception-with-message msg) > (make-exception-with-irritants msg-args))) > (_ (guile-external-error-converter key args))) > args)) > scheme@(ice-9 exceptions)> (set! guile-exception-converters (acons 'system-error my/guile-system-error-converter guile-exception-converters)) > scheme@(ice-9 exceptions)> ,m (guile-user) > scheme@(guile-user)> (guard (c ((message-condition? c) > (format #t "message: ~a~%" (condition-message c)))) > (canonicalize-path "/doesntexist")) > message: No such file or directory > $11 = #t > scheme@(guile-user)> > --8<---------------cut here---------------end--------------->8--- > > -- > Ricardo What do you think of using (ice-9 match) to make a universal throwage-formatter, with the idea of making readable top level code for how exceptions become messages on screen? I started a hack to explore the (throw 'whatever any ...) space, beginning like --8<---------------cut here---------------start------------->8--- (use-modules (ice-9 match)) (define (make-exception-message key rest) (begin (let*((l (cons key rest))) (match l (('system-error subr message args data ...) ;; e.g. thrown with key 'system-error: ("open-fdes" "~A" ("No such file or directory") (2)) (format #f (string-append "match-1: subr ~s threw '~s " message " sterror: ~s") subr key args (strerror (car (car data))))) (('signal any ...) ;; not yet implemented (format #f "match-2: any: ~s" any)) (('keyword-argument-error subr message args data) ;; with-crossed-fingers... (format #f (string-append "match-3: subr ~s threw '~s " message) subr key args)) ;; FIXME: string-append formats NAGI not a good idea, see a fix example below (('wrong-type-arg subr message (args ...) (data ...)) ;; E.g., thrown with key 'wrong-type-arg: ("sqrt" "Wrong type argument in position ~A: ~S" (1 x) (x)) (format #f "match-4: subr ~s threw '~s: ~s" subr key (format #f message args data))) (('out-of-range subr message (lo hi bad1) ((bad2))) ;; E.g., thrown with key 'out-of-range: (#f "Value out of range ~S to ~S: ~S" (0 3 4) (4)) (format #f "match-5: (internal) threw '~s: ~s" 'out-of-range (format #f message lo hi bad2))) (('unbound-variable #f message args data) ;; E.g. thrown with key 'unbound-variable: (#f "Unbound variable: ~S" (foo) #f) (format #f (string-append "match-6: subr ~s threw '~s " message) #f key args)) ;; data)) ;; FIXME: string-append formats NAGI [...] --8<---------------cut here---------------end--------------->8--- I made a guile hack that I could call from bash so I could type a line and (eval-string it) as a source of exceptions, and found that I could get secondary exceptions from make-exception-message, so I wrapped that with a (catch ...) something like --8<---------------cut here---------------start------------->8--- (define verbose-exception-handler (lambda (k . rest ) (begin (format #t "thrown with key '~s: ~s\n" k rest) (format #t "catch return=~a\n" (catch #t (lambda () (make-exception-message k rest)) (lambda (inner-key . inner-rest) (format #t "caught by inner handler: thrown with key '~s: ~s\n" inner-key inner-rest)))) ;; (format #t "thrown with key '~s: ~s\n" k rest) (newline) ;;;; [...] --8<---------------cut here---------------end--------------->8--- And using that like --8<---------------cut here---------------start------------->8--- (define (wrap-main args) (begin (display (catch #t (lambda () (apply main-defaults args)) verbose-exception-handler )))) --8<---------------cut here---------------end--------------->8--- (main-defaults sets up missing args and calls main with fixed args plus opt rest) I'm wondering if some of the obscure error messages I've encountered might be secondary, and could be clarified by wrapping the primary exception formatting similarly, (adding apropriate hint). WDYT? And is (ice-9 match) too massive to use for memory-limited platforms? BTW, does guile have a Content-type X-...-like standard for naming throw keys?, e.g. 'X-longjump-result-delivery if someone should want to use throw for non-"standard (?? :)" purposes? -- Regards, Bengt Richter From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 28 00:17:13 2020 Received: (at 41956) by debbugs.gnu.org; 28 Jun 2020 04:17:13 +0000 Received: from localhost ([127.0.0.1]:44922 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jpOkj-0001Sb-9P for submit@debbugs.gnu.org; Sun, 28 Jun 2020 00:17:13 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:40208) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jpOkh-0001SO-8a for 41956@debbugs.gnu.org; Sun, 28 Jun 2020 00:17:12 -0400 Received: by mail-qt1-f195.google.com with SMTP id i16so10523854qtr.7 for <41956@debbugs.gnu.org>; Sat, 27 Jun 2020 21:17:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=zgZIQcfxauoXA14iJGW/qiozO7OBX2VKA4Zce4qGQI0=; b=ebFvjl1cXJHmCSPntWZPjsH8CCgJrhukLy+11WPfz0S/ON9UtJLfw63f9Y7gNvswXx 3m8XUJrq6kwGJ6bvXkfU/2CJig59KZiVAN6FMfOvYznnRsZvfdufen9RchIa5YxTZW78 3RcD2d3aqE5EQO5yAwETuKrMSLvTSK9Lhlc1oCx7+Mx1mcidHlCWUYNAX9v/R7vMM/kc Feb2xYsAvi5N4iv1i5hOlitIMwh0/mmYRrI/YRY9vDwHsBlCl11azF37QvTWO+q/zZhU Ix99XX4pkznFtWxbywXaGjtSF98lcjc0AnKU8Hs7X4rb/DqNZULxKRlflD3k3YS9Xfer ouCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=zgZIQcfxauoXA14iJGW/qiozO7OBX2VKA4Zce4qGQI0=; b=pcd0BD4cxOyB2I7in52PQbC9B5+zM3DlIePAi9P68Qv8Ux8yGsMdyzGj1hu3gcSF8v EuYI2VjWA5T2kzqM8J55LhC+CplbYazHdNbm8zEh7k9JDUTL9RKBuzpIKFGl72aYChWa +Ct1UoYsSX8o8Hc8okqiHXdubluB109afrMC9UnQVY1N5Y10tW1tv17I4moquLP80s3h KNFrXrZYYLeL1cH9ElE4X8ioEhyBu7X/Az8aoMJl5Yzb6kgFYAJGSXWHJ3hZ+BnF9d+1 Gg0UjgKVahCzkoHkRffwfnaFHAn3hjwUo8HiSOtVoZRwCjtbrOLUCv1bqNNQSWGWSkUd 7yjg== X-Gm-Message-State: AOAM5327Co52q934PKD6Ke4Q8kL5FmtNxMwzgM9CqcZT2oXps6LTrfSY MyCn/HEPnvo3pesPc4EFtdGxiHnEbCc= X-Google-Smtp-Source: ABdhPJwEPjyIIlCrfPA+QVZZOb2oKOvT5lINdnPdHj3xNLSdjfJ6KxF7STFn8fwOheiteFa7gg7r7g== X-Received: by 2002:ac8:24c6:: with SMTP id t6mr9325395qtt.39.1593317825701; Sat, 27 Jun 2020 21:17:05 -0700 (PDT) Received: from hurd (dsl-150-161.b2b2c.ca. [66.158.150.161]) by smtp.gmail.com with ESMTPSA id e203sm9331106qkb.87.2020.06.27.21.17.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jun 2020 21:17:05 -0700 (PDT) From: Maxim Cournoyer To: Ricardo Wurmus Subject: Re: bug#41956: [PATCH] ice-9: exceptions: Properly format the error message. References: <87eeqad9m9.fsf@gmail.com> <87wo42mgre.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> <20200620183334.GA9490@LionPure> <87r1u9m62o.fsf@gmail.com> <87bll7qx5g.fsf@elephly.net> Date: Sun, 28 Jun 2020 00:17:04 -0400 In-Reply-To: <87bll7qx5g.fsf@elephly.net> (Ricardo Wurmus's message of "Thu, 25 Jun 2020 12:04:27 +0200") Message-ID: <87y2o7lt8f.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 41956 Cc: Bengt Richter , 41956@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Ricardo! Ricardo Wurmus writes: > Hi Maxim, > > here=E2=80=99s what I did in the REPL: > > scheme@(guile-user)> ,m (ice-9 exceptions) > scheme@(ice-9 exceptions)> (define (my/guile-system-error-converter key a= rgs) > (apply (case-lambda > ((subr msg-args msg errno . rest) > ;; XXX TODO we should return a more specific error > ;; (usually an I/O error) as expected by R6RS programs. > ;; Unfortunately this often requires the 'filename' (or > ;; other?) which is not currently provided by the native > ;; Guile exceptions. > (make-exception > (make-external-error) > (make-exception-with-origin subr) > (apply make-exception-with-message msg) > (make-exception-with-irritants msg-args))) > (_ (guile-external-error-converter key args))) > args)) > scheme@(ice-9 exceptions)> (set! guile-exception-converters (acons 'syste= m-error my/guile-system-error-converter guile-exception-converters)) > scheme@(ice-9 exceptions)> ,m (guile-user) > scheme@(guile-user)> (guard (c ((message-condition? c) > (format #t "message: ~a~%" (condition-message c)))) > (canonicalize-path "/doesntexist")) > message: No such file or directory > $11 =3D #t > scheme@(guile-user)>=20 I've tested that this indeed works, although I don't quite understand how? This brings embeds the definition of `guile-common-exceptions' into `guile-system-error-converter', with a single change: (make-exception-with-message msg) --> (apply make-exception-with-message msg msg-args) What is the magic I fail to see? Is this fix proper to be merged into the original guile-common-exceptions procedure? Thank you! Maxim From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 28 00:25:38 2020 Received: (at 41956) by debbugs.gnu.org; 28 Jun 2020 04:25:39 +0000 Received: from localhost ([127.0.0.1]:44954 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jpOss-0001fS-PQ for submit@debbugs.gnu.org; Sun, 28 Jun 2020 00:25:38 -0400 Received: from mail-qt1-f178.google.com ([209.85.160.178]:44706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jpOsp-0001fD-GW for 41956@debbugs.gnu.org; Sun, 28 Jun 2020 00:25:37 -0400 Received: by mail-qt1-f178.google.com with SMTP id j10so10506206qtq.11 for <41956@debbugs.gnu.org>; Sat, 27 Jun 2020 21:25:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=2KPz5ShPGwc5BmJ4KnB/q2Crvi4PsSxwlS+TT5ksMWo=; b=KnA7t5o45S/R0HzmKrkuRYo+OZQ6fKbuoGh/AyJudt/zvvsFBN171D5fogZSMpmrIe NpQIQONlFj6Q9eXT3QZZ9e0TdEmIBmwTpLQv2hEnVUXvUBVS85bvz/b2n5GH2RSOLYsh KOlJkteoYk/ZIouy+jT1nhlT4VhFDt5b2OYOOgaeZZqYTtx1walkidiQVMU5+qXYWXVH 1r6mi9yxYdZcMSkUpKrrjmCTBrp6H+bc1UgaNz4bVZhGi1YUmJnvy8eEMhy0zt7xIE2s zbGrxkjRJMHzQ3vdNFrF3WiOp7eIFk/kMrTxSkMLo/pVx85k+cSmACLAHdRLyufMjM/x vUeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=2KPz5ShPGwc5BmJ4KnB/q2Crvi4PsSxwlS+TT5ksMWo=; b=X7pCf8FfW0GJHAyp4FqyA/Ufqf0gwJBq+5HGWTOtTJWL2awL98bEKt1RGq/Qg9gCxk jNhUHydcmqmwDh/DEfKxRxMZzvNCB+PMCxVjt710HHOYOcwr4L2l4L5D6nSdSWn1IM1X BS+80O3hcyKzdTY1XnkmNuWsJ1iMGM4dCbQXAfB4j/xp1RbsATZtf82iZ5b8p8CWRWyg RMIecaUwO1kXlJXqURoI/nvmFNi3Rr3owMbzctLb0RYmFtUFXqDuNBMPGYc0Dnrk/zYS nLoYHr4uXb5bMiupIWmsEPGJPZWdAl5sP3oUHS6mCzhEHLuDQrJEHWqoaHT38w4YM2O0 WWxg== X-Gm-Message-State: AOAM532asbkYIRC2BOPLOeqdVXpAeTUNIDu4XwcPfvMBfx57YXTzRq39 /wh0bIL4CXNmJqUZmRSzLviI5VsjJN0= X-Google-Smtp-Source: ABdhPJzHizYvIFf/jkMgOW2fAVOEcZc7tNGL2rvMYJRHNyFUI6tgUoUKs2GXCfQukLUeNYvTIqBrxA== X-Received: by 2002:ac8:3a27:: with SMTP id w36mr10308460qte.196.1593318329930; Sat, 27 Jun 2020 21:25:29 -0700 (PDT) Received: from hurd (dsl-150-161.b2b2c.ca. [66.158.150.161]) by smtp.gmail.com with ESMTPSA id e129sm12454657qkf.132.2020.06.27.21.25.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jun 2020 21:25:29 -0700 (PDT) From: Maxim Cournoyer To: Bengt Richter Subject: Re: bug#41956: [PATCH] ice-9: exceptions: Properly format the error message. References: <87eeqad9m9.fsf@gmail.com> <87wo42mgre.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> <20200620183334.GA9490@LionPure> <87r1u9m62o.fsf@gmail.com> <87bll7qx5g.fsf@elephly.net> <20200625163341.GA4622@LionPure> Date: Sun, 28 Jun 2020 00:25:28 -0400 In-Reply-To: <20200625163341.GA4622@LionPure> (Bengt Richter's message of "Thu, 25 Jun 2020 18:33:41 +0200") Message-ID: <87tuyvlsuf.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 41956 Cc: Ricardo Wurmus , 41956@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Bengt, Bengt Richter writes: [...] > What do you think of using (ice-9 match) to make a universal throwage-formatter, > with the idea of making readable top level code for how exceptions become messages on screen? > > I started a hack to explore the (throw 'whatever any ...) space, beginning like > > (use-modules (ice-9 match)) > (define (make-exception-message key rest) > (begin > (let*((l (cons key rest))) > (match l > (('system-error subr message args data ...) > ;; e.g. thrown with key 'system-error: ("open-fdes" "~A" ("No such file or directory") (2)) > (format #f (string-append "match-1: subr ~s threw '~s " message " sterror: ~s") subr key args (strerror (car (car data))))) > > (('signal any ...) > ;; not yet implemented > (format #f "match-2: any: ~s" any)) Are you proposing to refactor (ice-9 exceptions) so that it's simpler to follow a condition message is formed for a given exception type? Maxim From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 28 00:31:55 2020 Received: (at 41956) by debbugs.gnu.org; 28 Jun 2020 04:31:55 +0000 Received: from localhost ([127.0.0.1]:44986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jpOyx-0001qC-IP for submit@debbugs.gnu.org; Sun, 28 Jun 2020 00:31:55 -0400 Received: from sender4-of-o51.zoho.com ([136.143.188.51]:21178) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jpOyv-0001q3-B0 for 41956@debbugs.gnu.org; Sun, 28 Jun 2020 00:31:54 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1593318710; cv=none; d=zohomail.com; s=zohoarc; b=N0jQxTWsIGyTdctozUSJnBmmynEen5ZLfGrxLnEjdQvwo+vAapS/B1XXvvJtTCbyurKBgRgmWtTYEnFCHDYdz1/foojqDn7GIFcU98wyV9Ag2bmebpTfFXTtAWl7+iTdvyhpYHMAV5OJPm3fkQLerjYb4Kat7974IVwtINjHYSA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593318710; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=FZ7kusxU2F47BuqlnqSMYgcJyAk6Bb4uErWYvDt8nDw=; b=hYTPWqufPnI37LT/hNSbcf1uGuc/TSm0/FZzW3pu37iEXZZU862InuftHXSg+xjDJTBwmia883jVh/BD7cyD66N7hSIGma93y+GTA86T4172MwSGu3LGW2a+jos0t4cfX22uwd3DmkPfPtsxq3IkqhDkshgIifLp8TsBtQdroXc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1593318710; s=zoho; d=elephly.net; i=rekado@elephly.net; h=References:From:To:Cc:Subject:In-reply-to:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=FZ7kusxU2F47BuqlnqSMYgcJyAk6Bb4uErWYvDt8nDw=; b=O14sQhyRy5MSuVhgZ07//uL0U7s290h/FlJJJ5GFcyiZ8OMTrThO7cuhdjaaQ3IO 1oYlC0g+0E5rcF/OfTW+S1ZsRQj/gGAqpkX864ZwxOUcT6U2lbo4w33nQnTMuifWKt9 GDEfpYejWL+6kbArj4qAju4ueRcBXmyofqED6wpw= Received: from localhost (p54ad49ac.dip0.t-ipconnect.de [84.173.73.172]) by mx.zohomail.com with SMTPS id 159331870745357.53082759699032; Sat, 27 Jun 2020 21:31:47 -0700 (PDT) References: <87eeqad9m9.fsf@gmail.com> <87wo42mgre.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> <20200620183334.GA9490@LionPure> <87r1u9m62o.fsf@gmail.com> <87bll7qx5g.fsf@elephly.net> <87y2o7lt8f.fsf@gmail.com> User-agent: mu4e 1.4.10; emacs 26.3 From: Ricardo Wurmus To: Maxim Cournoyer Subject: Re: bug#41956: [PATCH] ice-9: exceptions: Properly format the error message. In-reply-to: <87y2o7lt8f.fsf@gmail.com> X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Date: Sun, 28 Jun 2020 06:31:44 +0200 Message-ID: <875zbbq09b.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 41956 Cc: Bengt Richter , 41956@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Maxim, >> here=E2=80=99s what I did in the REPL: >> >> scheme@(guile-user)> ,m (ice-9 exceptions) >> scheme@(ice-9 exceptions)> (define (my/guile-system-error-converter key = args) >> (apply (case-lambda >> ((subr msg-args msg errno . rest) Here I changed the order: =E2=80=9Cmsg-args=E2=80=9D appears before =E2=80= =9Cmsg=E2=80=9D. I don=E2=80=99t know why the converter that=E2=80=99s currently in Guile assumes that the message comes first. >> scheme@(ice-9 exceptions)> (set! guile-exception-converters (acons 'syst= em-error my/guile-system-error-converter guile-exception-converters)) guile-exception-converters is a lookup table in (ice-9 exceptions). It associates error keys with converter procedures. Since canonicalize-path throws a 'system-error I chose to only update the 'system-error association. I didn=E2=80=99t want to affect all the other converter procedures that end up using the common converter; maybe they should be affected =E2=80=94 I don=E2=80=99t know because I don=E2=80=99t h= ave any test cases other than canonicalize-path. > This brings embeds the definition of `guile-common-exceptions' into > `guile-system-error-converter', with a single change: > > (make-exception-with-message msg) --> (apply make-exception-with-message > msg msg-args) > > What is the magic I fail to see? I cannot parse your sentence, so I=E2=80=99m not sure what you mean. > Is this fix proper to be merged into the original > guile-common-exceptions procedure? I think we should add tests of different exceptions with different keys to be sure that modifying the common handler doesn=E2=80=99t have any unexp= ected side-effects. --=20 Ricardo From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 28 14:23:29 2020 Received: (at 41956) by debbugs.gnu.org; 28 Jun 2020 18:23:29 +0000 Received: from localhost ([127.0.0.1]:46903 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jpbxh-0001vT-9h for submit@debbugs.gnu.org; Sun, 28 Jun 2020 14:23:29 -0400 Received: from imta-36.everyone.net ([216.200.145.36]:44774 helo=imta-38.everyone.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jpbxe-0001vJ-Cz for 41956@debbugs.gnu.org; Sun, 28 Jun 2020 14:23:28 -0400 Received: from pps.filterd (m0004960.ppops.net [127.0.0.1]) by imta-38.everyone.net (8.16.0.27/8.16.0.27) with SMTP id 05SIDeI7012658; Sun, 28 Jun 2020 11:23:25 -0700 X-Eon-Originating-Account: sh3BKjPTNI3k_fPVXj6L2ZGNdW-gRdwa2MPX3j81_zc X-Eon-Dm: m0116952.ppops.net Received: by m0116952.mta.everyone.net (EON-AUTHRELAY2 - 5a81c77a) id m0116952.5ef2521e.7ade2; Sun, 28 Jun 2020 11:23:23 -0700 X-Eon-Sig: AQMHrIJe+OAbHKoyFgIAAAAD,f158a132b3e460b8b1d9c1ff2ea9c0d0 X-Eip: RPkh7lJnw9MxzJ83RDHnjIs9-WeGXhQT65q1RLhl3js Date: Sun, 28 Jun 2020 20:23:13 +0200 From: Bengt Richter To: Maxim Cournoyer Subject: Re: bug#41956: [PATCH] ice-9: exceptions: Properly format the error message. Message-ID: <20200628182313.GA2809@LionPure> References: <87eeqad9m9.fsf@gmail.com> <87wo42mgre.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> <20200620183334.GA9490@LionPure> <87r1u9m62o.fsf@gmail.com> <87bll7qx5g.fsf@elephly.net> <20200625163341.GA4622@LionPure> <87tuyvlsuf.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87tuyvlsuf.fsf@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-28_11:2020-06-26, 2020-06-28 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2004280000 definitions=main-2006280138 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41956 Cc: Ricardo Wurmus , 41956@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Bengt Richter Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Maxim, Ricardo, On +2020-06-28 00:25:28 -0400, Maxim Cournoyer wrote: > Hello Bengt, > > Bengt Richter writes: > > > [...] > > > What do you think of using (ice-9 match) to make a universal throwage-formatter, > > with the idea of making readable top level code for how exceptions become messages on screen? > > > > I started a hack to explore the (throw 'whatever any ...) space, beginning like > > > > (use-modules (ice-9 match)) > > (define (make-exception-message key rest) > > (begin > > (let*((l (cons key rest))) > > (match l > > (('system-error subr message args data ...) > > ;; e.g. thrown with key 'system-error: ("open-fdes" "~A" ("No such file or directory") (2)) > > (format #f (string-append "match-1: subr ~s threw '~s " message " sterror: ~s") subr key args (strerror (car (car data))))) > > > > (('signal any ...) > > ;; not yet implemented > > (format #f "match-2: any: ~s" any)) > > Are you proposing to refactor (ice-9 exceptions) so that it's simpler to > follow a condition message is formed for a given exception type? > > Maxim Well, there's probably no catching up with Ludo and Andy, judging from NEWS[1], specifically [2], so practically speaking, no. I was just floating the idea :) You may have noticed the "match-1" in e.g. --8<---------------cut here---------------start------------->8--- > > (format #f (string-append "match-1: subr ~s threw '~s " message " sterror: ~s") subr key args (strerror (car (car data))))) --8<---------------cut here---------------end--------------->8--- above. The idea there was to find easily the exact format expression that did the output, (using the tag, to be included per some debug flag or env, but otherwise doing standard error reporting.) A simple sequence of matches makes it easy to include such debug tags and find them in the code. (not always easy without tags, I found :) I guess if match is sequentially implemented like an if-elif*-else chain, it could be too slow without a generic dispatch to different specialized match sequences, like the dispatch being used now in --8<---------------cut here---------------start------------->8--- define (convert-guile-exception key args) (let ((converter (assv-ref guile-exception-converters key))) (make-exception (or (and converter (converter key args)) (default-guile-exception-converter key args)) (make-exception-with-kind-and-args key args)))) --8<---------------cut here---------------end--------------->8--- ┌────────────────────────────────────────────────────────────────────────┐ │ BTW, I wonder if using a hash table and hashv-ref instead off assv-ref │ │ would make any noticeable speed difference for anyone. │ └────────────────────────────────────────────────────────────────────────┘ The commit diffs on match sequences would become a revision history for the fixes that will probably continue to be necessary, yet the simple surface syntax would be understandable by a newbie. Actually, looking at the code, I think I will get away while I can, before I start seeing udev rules in the mix :) IRL, my next hack might be a (false-if-exception-with-report sexpr) that would ouput to (current-error-port) if an exception does occur, besides returning #f like the plain false-if-exception. First a guaranteed (format (current-error-port) "key=<~s> args=~s\n" key args) seen by the handler, then something more verbose and informative. Just as a hacking tool, when I want to paper something over, but also want to know what's happening ;-) Unfortunately, it probably won't help with syntax errors not finding closing quotes or parens and hitting eof ;/ Hope I haven't annoyed anyone. [1] https://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob_plain;f=NEWS;hb=5e1748f75128107e3a0707b66df5adb95d98437e (I guess that's up to date, I git cloned the repo and first read the NEWS there. LOTS going on ;-) [2] Snip of part I wanted to indicate: --8<---------------cut here---------------start------------->8--- ** Reimplementation of exceptions Since Guile's origins 25 years ago, `throw' and `catch' have been the primary exception-handling primitives. However these primitives have two problems. One is that it's hard to handle exceptions in a structured way using `catch'. Few people remember what the corresponding `key' and `args' are that an exception handler would see in response to a call to `error', for example. In practice, this results in more generic catch-all exception handling than one might like. The other problem is that `throw', `catch', and especially `with-throw-handler' are quite unlike what the rest of the Scheme world uses. R6RS and R7RS, for example, have mostly converged on SRFI-34-style `with-exception-handler' and `raise' primitives, and encourage the use of SRFI-35-style structured exception objects to describe the error. Guile's R6RS layer incorporates an adapter between `throw'/`catch' and structured exception handling, but it didn't apply to SRFI-34/SRFI-35, and we would have to duplicate it for R7RS. In light of these considerations, Guile has now changed to make `with-exception-handler' and `raise-exception' its primitives for exception handling and defined a hierarchy of R6RS-style exception types in its core. SRFI-34/35, R6RS, and the exception-handling components of SRFI-18 (threads) have been re-implemented in terms of this core functionality. There is also a a compatibility layer that makes it so that exceptions originating in `throw' can be handled by `with-exception-hander', and vice-versa for `raise-exception' and `catch'. Generally speaking, users will see no difference. The one significant difference is that users of SRFI-34 will see more exceptions flowing through their `with-exception-handler'/`guard' forms, because whereas before they would only see exceptions thrown by SRFI-34, now they will see exceptions thrown by R6RS, R7RS, or indeed `throw'. Guile's situation is transitional. Most exceptions are still signalled via `throw'. These will probably migrate over time to `raise-exception', while preserving compatibility of course. See "Exceptions" in the manual, for full details on the new API. --8<---------------cut here---------------end--------------->8--- -- Regards, Bengt Richter From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 02 10:45:28 2021 Received: (at 41956) by debbugs.gnu.org; 2 Jun 2021 14:45:28 +0000 Received: from localhost ([127.0.0.1]:41069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1loS7b-0005cE-UU for submit@debbugs.gnu.org; Wed, 02 Jun 2021 10:45:28 -0400 Received: from mx1.riseup.net ([198.252.153.129]:58680) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1loLMg-0007h0-BR for 41956@debbugs.gnu.org; Wed, 02 Jun 2021 03:32:34 -0400 Received: from fews1.riseup.net (fews1-pn.riseup.net [10.0.1.83]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4Fw12N5RNpzDqhB for <41956@debbugs.gnu.org>; Wed, 2 Jun 2021 00:32:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1622619148; bh=fnb+DQFHxNDSf6DOUOAnwL/6l3RC4lpHUdK05BQG570=; h=Subject:From:Reply-To:To:Date:From; b=F3uSFcTF5IW4rsZV9AjoAD0+zSIr2f3acVD/LMF3SSdpD6T83z61wycuf33OGRxMU UWbtsy3yh/h7QzSF1om37EmsfUaPtXOWagw8QEmk1mU8shi6srqHj/0Q0xw8zMQOuh QeJZOZTY3PmTHwQGwVRUexPfg6Vpu/sCrxeJgHHQ= X-Riseup-User-ID: 047CB06AA68A6EBDE18F77B0D7FA726F39769C5C705735EBE73747B8E597F3C2 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews1.riseup.net (Postfix) with ESMTPSA id 4Fw12M6kzBz5vqb for <41956@debbugs.gnu.org>; Wed, 2 Jun 2021 00:32:27 -0700 (PDT) Message-ID: <7fd3319aad78a597b9d8855ede45849f6d562e05.camel@riseup.net> Subject: is this still current ? From: Adriano Peluso To: 41956@debbugs.gnu.org Date: Wed, 02 Jun 2021 09:32:24 +0200 Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41956 X-Mailman-Approved-At: Wed, 02 Jun 2021 10:45:26 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: randomlooser@riseup.net Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) I understand that a overhaul of the exceptions stack intervened while this bug was open Is this still current ? From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 09 23:18:36 2023 Received: (at 41956) by debbugs.gnu.org; 10 Nov 2023 04:18:36 +0000 Received: from localhost ([127.0.0.1]:49283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1IyZ-0000ME-Rs for submit@debbugs.gnu.org; Thu, 09 Nov 2023 23:18:36 -0500 Received: from mail-qv1-xf32.google.com ([2607:f8b0:4864:20::f32]:46252) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1IyV-0000Lx-II for 41956@debbugs.gnu.org; Thu, 09 Nov 2023 23:18:34 -0500 Received: by mail-qv1-xf32.google.com with SMTP id 6a1803df08f44-66d190a8f87so10073806d6.0 for <41956@debbugs.gnu.org>; Thu, 09 Nov 2023 20:17:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699589866; x=1700194666; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=WmXw6rWjP5bAfHheLneoazWhSh1/inAPYJITX2ApraA=; b=hCIuJu9+na+0qzmYRnxNe89LpfnqqsyDPw+HtbSOvQRMmUZwzFssNAP55rrmve5tom Tj9y9ggBdaFTQjFaD6LK4hXtTo3y6N49AwnG2R5svic2Qx/bISRbSPoXfheIgX/6Zu0p 0MLM4yLR69XAmFKKEWX6aRYR+6ycjJzUtFXZwmVkAjRg76S02wRgjsh60TKyBHR48pl/ ggi6Senv7IQ/Pcm7Fi9ngKZP705l6Ni3/ZorpyKiqapTErXvdHpkM0Sve9tQtmw31lql KTf5dNGTAahU+/va8bZToKXwaneIHKGLxVw1yQBlo4mYuIkQovR+eeW7Xxt1T6eKdXCl 0yjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699589866; x=1700194666; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=WmXw6rWjP5bAfHheLneoazWhSh1/inAPYJITX2ApraA=; b=w8Iigai843g9boNK9JO6Hcs9RtSUCz3mWpyXivcOl7Hw3UtSt+dUFrpFNE6YFZkL/z MOGu169jj+jq5UZwUd0Y99O1fmHwuun3aZWmzjb4QrZ6Ok4Rhga7cb8nK/TXYmCvvvO/ Kvt3sGSkz/6rrMa9gcJwZ1O3WgBgqYO4dm/Cqq+xSNhzpb48NvR5nZUi/9Ny4on2l22z AJYalVwZay2JoccZ4OCve53BTa98Pi/Z8kbOA/Uf8oObrCt6oz70eFbaCqIIw6t8EmPN EKhyh6jST0EBTTknNTInBZZ8TAaPsxJvwBEFuOcYnvX5L2gmBcuMpZVUFdZLjK8JILI4 TtCQ== X-Gm-Message-State: AOJu0YxAVhUJr6MVPx2bpuc6tp+61E87IrJsd+x9kIFnrhvep8DQrqKT ba7PBSM8Ve0oQUQf0xyDihE= X-Google-Smtp-Source: AGHT+IEIplGI77s0p/vvJkwOvbBt3L01FxwU7IXTfHsPESelmUNugWxHxqthMJX9OCJnLV6i7dxv/g== X-Received: by 2002:a05:6214:2029:b0:671:3493:61e8 with SMTP id 9-20020a056214202900b00671349361e8mr8056129qvf.26.1699589866318; Thu, 09 Nov 2023 20:17:46 -0800 (PST) Received: from hurd (dsl-10-129-91.b2b2c.ca. [72.10.129.91]) by smtp.gmail.com with ESMTPSA id n3-20020a0cfbc3000000b0065b13180892sm2648605qvp.16.2023.11.09.20.17.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 20:17:45 -0800 (PST) From: Maxim Cournoyer To: Adriano Peluso Subject: Re: bug#41956: is this still current ? In-Reply-To: <7fd3319aad78a597b9d8855ede45849f6d562e05.camel@riseup.net> (Adriano Peluso's message of "Wed, 02 Jun 2021 09:32:24 +0200") References: <87eeqad9m9.fsf@gmail.com> <7fd3319aad78a597b9d8855ede45849f6d562e05.camel@riseup.net> Date: Thu, 09 Nov 2023 23:17:44 -0500 Message-ID: <875y2afdhz.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 41956 Cc: Ricardo Wurmus , Bengt Richter , 41956@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Adriano Peluso writes: > I understand that a overhaul of the exceptions stack intervened while > this bug was open > > Is this still current ? Yes. The affected code hasn't been touched since 2019. To recall, the reproducer is this: --8<---------------cut here---------------start------------->8--- (use-modules (srfi srfi-34) (srfi srfi-35)) (guard (c ((message-condition? c) (format #t "error: ~a~%" (condition-message c)))) (canonicalize-path "/no/such/path")) --8<---------------cut here---------------end--------------->8--- or this: --8<---------------cut here---------------start------------->8--- (use-modules (srfi srfi-34) (srfi srfi-35)) (guard (c ((message-condition? c) (format #t "error: ~a~%" (condition-message c)))) ;; This is what (canonicalize-path "/do/not/exist) ends up doing: (throw 'system-error "canonicalize-path" "~A" '("No such file or directory"))) error: ~A --8<---------------cut here---------------end--------------->8--- -- Thanks, Maxim