From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Bengt Richter Newsgroups: gmane.lisp.guile.bugs Subject: bug#41956: [PATCH] ice-9: exceptions: Properly format the error message. Date: Sat, 20 Jun 2020 20:33:34 +0200 Message-ID: <20200620183334.GA9490@LionPure> References: <87eeqad9m9.fsf@gmail.com> <87wo42mgre.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> Reply-To: Bengt Richter Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="23788"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: 41956@debbugs.gnu.org To: maxim.cournoyer@gmail.com Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Sat Jun 20 20:34:07 2020 Return-path: Envelope-to: guile-bugs@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 1jmiJb-000648-LZ for guile-bugs@m.gmane-mx.org; Sat, 20 Jun 2020 20:34:07 +0200 Original-Received: from localhost ([::1]:37754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmiJa-0007fu-9y for guile-bugs@m.gmane-mx.org; Sat, 20 Jun 2020 14:34:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmiJW-0007fe-KR for bug-guile@gnu.org; Sat, 20 Jun 2020 14:34:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47211) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jmiJW-0005rk-Bu for bug-guile@gnu.org; Sat, 20 Jun 2020 14:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jmiJW-0000jD-9V for bug-guile@gnu.org; Sat, 20 Jun 2020 14:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Bengt Richter Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 20 Jun 2020 18:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41956 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch Original-Received: via spool by 41956-submit@debbugs.gnu.org id=B41956.15926780362788 (code B ref 41956); Sat, 20 Jun 2020 18:34:02 +0000 Original-Received: (at 41956) by debbugs.gnu.org; 20 Jun 2020 18:33:56 +0000 Original-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 Original-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 Original-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 Original-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 Content-Disposition: inline In-Reply-To: <87wo42mgre.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:9815 Archived-At: 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