X-Loop: help-debbugs@HIDDEN Subject: bug#41956: [PATCH] ice-9: exceptions: Properly format the error message. Resent-From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-guile@HIDDEN Resent-Date: Fri, 19 Jun 2020 21:34:01 +0000 Resent-Message-ID: <handler.41956.B.159260239130354 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 41956 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch To: 41956 <at> debbugs.gnu.org X-Debbugs-Original-To: bug-guile@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.159260239130354 (code B ref -1); Fri, 19 Jun 2020 21:34:01 +0000 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 <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jmOdL-0007tW-Ia for submit <at> 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 <maxim.cournoyer@HIDDEN>) id 1jmOdH-0007tM-DT for submit <at> 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 <maxim.cournoyer@HIDDEN>) id 1jmOdH-0006s9-5z for bug-guile@HIDDEN; 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 <maxim.cournoyer@HIDDEN>) id 1jmOdF-0007lr-Gs for bug-guile@HIDDEN; Fri, 19 Jun 2020 17:33:06 -0400 Received: by mail-qv1-xf44.google.com with SMTP id dp10so5159289qvb.10 for <bug-guile@HIDDEN>; 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 <bug-guile@HIDDEN> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2020 14:33:03 -0700 (PDT) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> Date: Fri, 19 Jun 2020 17:33:02 -0400 Message-ID: <87eeqad9m9.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::f44; envelope-from=maxim.cournoyer@HIDDEN; 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-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> 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 <maxim.cournoyer@HIDDEN> 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 --=-=-=--
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Maxim Cournoyer <maxim.cournoyer@HIDDEN> Subject: bug#41956: Acknowledgement ([PATCH] ice-9: exceptions: Properly format the error message.) Message-ID: <handler.41956.B.159260239130354.ack <at> debbugs.gnu.org> References: <87eeqad9m9.fsf@HIDDEN> X-Gnu-PR-Message: ack 41956 X-Gnu-PR-Package: guile X-Gnu-PR-Keywords: patch Reply-To: 41956 <at> debbugs.gnu.org Date: Fri, 19 Jun 2020 21:34:01 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-guile@HIDDEN If you wish to submit further information on this problem, please send it to 41956 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 41956: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D41956 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN Subject: bug#41956: [PATCH] ice-9: exceptions: Properly format the error message. Resent-From: maxim.cournoyer@HIDDEN Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-guile@HIDDEN Resent-Date: Sat, 20 Jun 2020 05:47:02 +0000 Resent-Message-ID: <handler.41956.B41956.159263198311294 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 41956 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch To: Maxim Cournoyer <maxim.cournoyer@HIDDEN> Cc: 41956 <at> debbugs.gnu.org Received: via spool by 41956-submit <at> debbugs.gnu.org id=B41956.159263198311294 (code B ref 41956); Sat, 20 Jun 2020 05:47:02 +0000 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 <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jmWKd-0002w6-B0 for submit <at> 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 <maxim.cournoyer@HIDDEN>) id 1jmWKb-0002vr-F5 for 41956 <at> 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 <at> 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@HIDDEN X-Google-Original-From: maxim@HIDDEN References: <87eeqad9m9.fsf@HIDDEN> Date: Sat, 20 Jun 2020 01:46:13 -0400 In-Reply-To: <87eeqad9m9.fsf@HIDDEN> (Maxim Cournoyer's message of "Fri, 19 Jun 2020 17:33:02 -0400") Message-ID: <87wo42mgre.fsf@HIDDEN> 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-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Maxim Cournoyer <maxim.cournoyer@HIDDEN> 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
X-Loop: help-debbugs@HIDDEN Subject: bug#41956: [PATCH] ice-9: exceptions: Properly format the error message. Resent-From: Bengt Richter <bokr@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-guile@HIDDEN Resent-Date: Sat, 20 Jun 2020 18:34:02 +0000 Resent-Message-ID: <handler.41956.B41956.15926780362788 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 41956 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch To: maxim.cournoyer@HIDDEN Cc: 41956 <at> debbugs.gnu.org Reply-To: Bengt Richter <bokr@HIDDEN> Received: via spool by 41956-submit <at> debbugs.gnu.org id=B41956.15926780362788 (code B ref 41956); Sat, 20 Jun 2020 18:34:02 +0000 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 <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jmiJQ-0000iu-Lh for submit <at> 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 <bokr@HIDDEN>) id 1jmiJN-0000il-Tw for 41956 <at> 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 <bokr@HIDDEN> Message-ID: <20200620183334.GA9490@LionPure> References: <87eeqad9m9.fsf@HIDDEN> <87wo42mgre.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87wo42mgre.fsf@HIDDEN> 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-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> 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@HIDDEN wrote: > Maxim Cournoyer <maxim.cournoyer@HIDDEN> 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
X-Loop: help-debbugs@HIDDEN Subject: bug#41956: [PATCH] ice-9: exceptions: Properly format the error message. Resent-From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-guile@HIDDEN Resent-Date: Sun, 21 Jun 2020 03:50:01 +0000 Resent-Message-ID: <handler.41956.B41956.159271137730677 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 41956 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch To: Bengt Richter <bokr@HIDDEN> Cc: 41956 <at> debbugs.gnu.org Received: via spool by 41956-submit <at> debbugs.gnu.org id=B41956.159271137730677 (code B ref 41956); Sun, 21 Jun 2020 03:50:01 +0000 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 <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jmqzB-0007yj-4w for submit <at> 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 <maxim.cournoyer@HIDDEN>) id 1jmqz8-0007yV-TR for 41956 <at> 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 <at> 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 <maxim.cournoyer@HIDDEN> References: <87eeqad9m9.fsf@HIDDEN> <87wo42mgre.fsf@HIDDEN> <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@HIDDEN> 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-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hello Bengt! Bengt Richter <bokr@HIDDEN> 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
X-Loop: help-debbugs@HIDDEN Subject: bug#41956: [PATCH] ice-9: exceptions: Properly format the error message. Resent-From: Ricardo Wurmus <rekado@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-guile@HIDDEN Resent-Date: Thu, 25 Jun 2020 10:05:01 +0000 Resent-Message-ID: <handler.41956.B41956.15930794836275 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 41956 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch To: Maxim Cournoyer <maxim.cournoyer@HIDDEN> Cc: 41956 <at> debbugs.gnu.org, Bengt Richter <bokr@HIDDEN> Received: via spool by 41956-submit <at> debbugs.gnu.org id=B41956.15930794836275 (code B ref 41956); Thu, 25 Jun 2020 10:05:01 +0000 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 <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1joOkM-0001d9-QD for submit <at> 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 <rekado@HIDDEN>) id 1joOkI-0001cx-JK for 41956 <at> 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@HIDDEN; dmarc=pass header.from=<rekado@HIDDEN> header.from=<rekado@HIDDEN> DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1593079475; s=zoho; d=elephly.net; i=rekado@HIDDEN; 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@HIDDEN> <87wo42mgre.fsf@HIDDEN> <20200620183334.GA9490@LionPure> <87r1u9m62o.fsf@HIDDEN> User-agent: mu4e 1.4.10; emacs 26.3 From: Ricardo Wurmus <rekado@HIDDEN> In-reply-to: <87r1u9m62o.fsf@HIDDEN> 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@HIDDEN> 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-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> 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
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.