From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.bugs Subject: bug#75065: Upon archive download failure print the original error Date: Thu, 26 Dec 2024 23:14:10 +0300 Message-ID: References: <4361fa59c17dc06b285fea25f025a9e86f81d1fe.camel@yandex.ru> <867c7mzuva.fsf@gnu.org> <87bjwytis3.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28968"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.54.2 Cc: 75065@debbugs.gnu.org, Eli Zaretskii To: Stefan Monnier , Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 26 21:15:13 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1tQuGH-0007NK-KF for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Dec 2024 21:15:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQuG8-000428-3Y; Thu, 26 Dec 2024 15:15:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tQuG6-00041P-NO for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2024 15:15:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQuG6-0004F5-FS for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2024 15:15:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=l4cEediZ51KQNLoOfP6SPWf1cS43IsMxXdHYbz66HX8=; b=Uv3wlrXFcWgpq9vNkLr4IIpBTYkXPdqdtkqLZ8O4WLUBYKFlKmWowD0gCxTB6HYFroELvwBIbux8mAqiPEDYttaXCXcPl/tulrRXVfXh4BUoz3ItJjNsVlgXvTLyZeCGjkL78DqAwwGESvtvJooNGCBhSSVWQKJ2s8PTQUWsqFM4IhBqaLFKf1Jl5rG4YZNLLVpvb8gghUFUcLkmqj4rQWPtAGhaCEhWQ/gjiN35LC13uDJx3ADRsCRRxJCxdQeHlQVKfjoxePVdZdDCQ7Gc5xLtGZV9rVLd1sJoQjMl8uDQQCK6TSCfEsokfgUx0cJmu+YcLQ82lsNMwsqjl0Q8mQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tQuG6-0007pa-9y for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2024 15:15:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Dec 2024 20:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75065 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 75065-submit@debbugs.gnu.org id=B75065.173524407330053 (code B ref 75065); Thu, 26 Dec 2024 20:15:02 +0000 Original-Received: (at 75065) by debbugs.gnu.org; 26 Dec 2024 20:14:33 +0000 Original-Received: from localhost ([127.0.0.1]:42322 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQuFd-0007of-7x for submit@debbugs.gnu.org; Thu, 26 Dec 2024 15:14:33 -0500 Original-Received: from forward501a.mail.yandex.net ([178.154.239.81]:56162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQuFa-0007oQ-U2 for 75065@debbugs.gnu.org; Thu, 26 Dec 2024 15:14:32 -0500 Original-Received: from mail-nwsmtp-smtp-production-main-81.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-81.vla.yp-c.yandex.net [IPv6:2a02:6b8:c15:339a:0:640:a002:0]) by forward501a.mail.yandex.net (Yandex) with ESMTPS id 3024761FE1; Thu, 26 Dec 2024 23:14:14 +0300 (MSK) Original-Received: by mail-nwsmtp-smtp-production-main-81.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id BEgmKssOgW20-Yw0OxQRJ; Thu, 26 Dec 2024 23:14:13 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1735244053; bh=l4cEediZ51KQNLoOfP6SPWf1cS43IsMxXdHYbz66HX8=; h=References:Date:In-Reply-To:Cc:To:From:Subject:Message-ID; b=ldo+lYcsQPsUddu1YYuLlDlUwc/XwSXGdfWdKS+GdeO9ab3o1qd4RF9egy/V/eAsy P4xNjABLmbToK9q6t/RuMFNem5f6vL9U4G3TuoaOnPpI0LPAaH6WZjzJaGbTyvNbQ1 zmMvNRnr6S3N2JPTcjYIjaXbkrLX2MTaIbDhk0mE= Authentication-Results: mail-nwsmtp-smtp-production-main-81.vla.yp-c.yandex.net; dkim=pass header.i=@yandex.ru In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297784 Archived-At: On Thu, 2024-12-26 at 14:17 -0500, Stefan Monnier wrote: > > > > =C2=A0=C2=A0 (dolist (archive package-archives) > > > > -=C2=A0=C2=A0=C2=A0 (condition-case-unless-debug nil > > > > +=C2=A0=C2=A0=C2=A0 (condition-case-unless-debug err > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (package--download= -one-archive archive "archive- > > > > contents" async) > > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (error (message "Failed to download= `%s' archive." > > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 (car archive)))))) > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (error (message "Failed to download= `%s' archive. Error: > > > > %S" > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 (car archive) (cdr err)))))) > > > > > > > Stefan and Philip, is this okay to install? > > I agree with the idea behind the patch, but printing just `(cdr err)` > doesn't seem right, it should print the whole of `err`. The `car` seems to just contain word error. Here's how both compare: =E2=80=A2 current patch with `(cdr err)`: Failed to download =E2=80=98melpa=E2=80=99 archive. Error: ("Location m= elpa.org/packages/ is not a url nor an absolute file name") =E2=80=A2 suggested change with `err`: Failed to download =E2=80=98melpa=E2=80=99 archive. Error: (error "Loca= tion melpa.org/packages/ is not a url nor an absolute file name") I can of course remove the word `Error` in the second case. My question then is: will `(car err)` always be the word "error"? Or may there be another content? > > It seems harmless, I am just uncertain if we should prefer %S or %s > > to > > format the error message. > > `%s` to print `err` or `(cdr err)` would be wrong, since `%s` is for > use > with strings rather than lists.=C2=A0 IOW, IMO, it should be either > > =C2=A0=C2=A0=C2=A0 ...%S" ... err) > > or > > =C2=A0=C2=A0=C2=A0 ...%s" ... (error-message-string err)) > > where the first is a bit more "debugging/developer" friendly and the > second > is a bit more "user" friendly. In my tests there seems to be no difference in the output between %s and %S. I would presume doing `(message "%s" '(a b))` would result in error as the param isn't a string, but it works.