From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Ricardo Wurmus Newsgroups: gmane.lisp.guile.bugs Subject: bug#41956: [PATCH] ice-9: exceptions: Properly format the error message. Date: Sun, 28 Jun 2020 06:31:44 +0200 Message-ID: <875zbbq09b.fsf@elephly.net> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="13890"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.10; emacs 26.3 Cc: 41956@debbugs.gnu.org To: Maxim Cournoyer Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Sun Jun 28 06:32:08 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 1jpOz9-0003Uy-KY for guile-bugs@m.gmane-mx.org; Sun, 28 Jun 2020 06:32:08 +0200 Original-Received: from localhost ([::1]:36244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jpOz8-0005v7-5c for guile-bugs@m.gmane-mx.org; Sun, 28 Jun 2020 00:32:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jpOz4-0005v0-4Y for bug-guile@gnu.org; Sun, 28 Jun 2020 00:32:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33440) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jpOz3-00081t-RV for bug-guile@gnu.org; Sun, 28 Jun 2020 00:32:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jpOz3-0001qW-P1 for bug-guile@gnu.org; Sun, 28 Jun 2020 00:32:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ricardo Wurmus Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 28 Jun 2020 04:32:01 +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.15933187157084 (code B ref 41956); Sun, 28 Jun 2020 04:32:01 +0000 Original-Received: (at 41956) by debbugs.gnu.org; 28 Jun 2020 04:31:55 +0000 Original-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 Original-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= Original-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) 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 X-ZohoMailClient: External 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:9835 Archived-At: 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