From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#75065: Upon archive download failure print the original error Date: Thu, 26 Dec 2024 15:40:21 -0500 Message-ID: References: <4361fa59c17dc06b285fea25f025a9e86f81d1fe.camel@yandex.ru> <867c7mzuva.fsf@gnu.org> <87bjwytis3.fsf@posteo.net> Reply-To: Stefan Monnier 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="40005"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 75065@debbugs.gnu.org, Philip Kaludercic , Eli Zaretskii To: Konstantin Kharlamov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 26 21:41:25 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 1tQufc-000AB9-HX for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Dec 2024 21:41:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQufI-0006K4-VT; Thu, 26 Dec 2024 15:41:05 -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 1tQufG-0006Jh-Mo for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2024 15:41: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 1tQufG-0006fD-EY for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2024 15:41: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:Date:References:In-Reply-To:From:To:Subject; bh=q+yV4M79PdM41qYarGvEoZ57mEm+Gd4EnVwoVdNlbhc=; b=TCiGKVbwNB1dYpyoiNmtdJnks7XlzpbzOrcHN5EfZ8QcTjiHz62JHLFaAbcf73GbyKhmS/EHoNTCUJMoTD2Zxo8/4DsvFTu/p2AZGrCsm90Jvx3v4i5bSIA+ZiL1741uJjZVfujp6oqBNaz3oO61VHq6vgHFAdCAd35+ngX5QRVW+lXSxSfOXHda94hq1Bhfx4ChCmQKy8kEiGZM4cviLC6TWaL1QWOLYUjha6O3l9FDNFCUtYNctQHtydMrnRs/Z2FU14oNVRdOjJorEfflXSjInBRiDeLMFZub6kqdIi5MVAmWnrJq+jtSrYuTGsTbxX9fZyfWrNfB0Q7UUCN59w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tQufG-0000fR-3g for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2024 15:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Dec 2024 20:41: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.17352456342512 (code B ref 75065); Thu, 26 Dec 2024 20:41:02 +0000 Original-Received: (at 75065) by debbugs.gnu.org; 26 Dec 2024 20:40:34 +0000 Original-Received: from localhost ([127.0.0.1]:42374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQuen-0000eS-Lg for submit@debbugs.gnu.org; Thu, 26 Dec 2024 15:40:34 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:9512) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQuel-0000eB-Eo for 75065@debbugs.gnu.org; Thu, 26 Dec 2024 15:40:32 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 628FD8086A; Thu, 26 Dec 2024 15:40:23 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1735245622; bh=sCpG1ds4T+peRnwLINOzCNESZRqyrLC/K7gOrbhJAj8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=cdAjHOiN5o1LD6fETCXZA59jnfG8QEPwMkga61BCXH2+mZSiq2lI92BbnOOYN9TQj GwW7BitAzBkVzQPpfkBa5rCLCFWdHEl7AOgvDdEGooAxNHZ/oMX8s0P3shD1LQOynZ rohlSUOywYGNFz3nTfdgjaE5kQLuq4icoS/46BAiPvqwMVkaWNIepCbLKmdDrXwOPt 250MU9fjjis3Z0Aj0bUlnXgp77OPM2YpSqdjrhVyRUh6A2EaAP7zMZktCOcAPglDSx KAvc/LAUEf8sHnzrG9nYkCzeFtmdwpiNPhadg8Ji0PN7F8Fyd0cR3h+GntvjR8oNln c9ydz3CKIxDGw== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 686B4801CC; Thu, 26 Dec 2024 15:40:22 -0500 (EST) Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4DBE5120311; Thu, 26 Dec 2024 15:40:22 -0500 (EST) In-Reply-To: (Konstantin Kharlamov's message of "Thu, 26 Dec 2024 23:14:10 +0300") 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:297787 Archived-At: > 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= melpa.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 "Lo= cation 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? The shape and content of `err` depends on the actual error that caused the download to fail. `(car err)` contains the error "type", which can be `error` but can also be more specific such as `wrong-number-of-arguments`, `file-error`, ... >> > 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. Try (format "%S" '(a "b")) vs (format "%s" '(a "b")) > I would presume doing `(message "%s" '(a b))` would result in > error as the param isn't a string, but it works. I agree that in an ideal world it should signal an error, but here we are. Stefan