From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: maxim.cournoyer@gmail.com Newsgroups: gmane.lisp.guile.bugs Subject: bug#41956: [PATCH] ice-9: exceptions: Properly format the error message. Date: Sat, 20 Jun 2020 01:46:13 -0400 Message-ID: <87wo42mgre.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> References: <87eeqad9m9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="28749"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: 41956@debbugs.gnu.org To: Maxim Cournoyer Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Sat Jun 20 07:47:09 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 1jmWLN-0007Ny-34 for guile-bugs@m.gmane-mx.org; Sat, 20 Jun 2020 07:47:09 +0200 Original-Received: from localhost ([::1]:46114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmWLM-0001aD-0r for guile-bugs@m.gmane-mx.org; Sat, 20 Jun 2020 01:47:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmWLG-0001Zt-Pf for bug-guile@gnu.org; Sat, 20 Jun 2020 01:47:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45609) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jmWLG-0000S0-Gz for bug-guile@gnu.org; Sat, 20 Jun 2020 01:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jmWLG-0002wz-Eo for bug-guile@gnu.org; Sat, 20 Jun 2020 01:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: maxim.cournoyer@gmail.com Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 20 Jun 2020 05:47: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.159263198311294 (code B ref 41956); Sat, 20 Jun 2020 05:47:02 +0000 Original-Received: (at 41956) by debbugs.gnu.org; 20 Jun 2020 05:46:23 +0000 Original-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 Original-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 Original-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) Original-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) X-Google-Original-From: maxim@hurd.i-did-not-set--mail-host-address--so-tickle-me In-Reply-To: <87eeqad9m9.fsf@gmail.com> (Maxim Cournoyer's message of "Fri, 19 Jun 2020 17:33:02 -0400") 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:9812 Archived-At: 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