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:37:31 +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="29190"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.54.2 Cc: 75065@debbugs.gnu.org, Eli Zaretskii To: Stefan Kangas , 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:38:19 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 1tQucc-0007SW-Iw for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Dec 2024 21:38:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQucO-0005uO-6r; Thu, 26 Dec 2024 15:38: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 1tQucM-0005uA-NZ for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2024 15:38: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 1tQucM-0006Lt-FC for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2024 15:38: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=GSHJoO6flt9wZu0YtI37csXjBuyNQJcO4u71zk0Ejnk=; b=QJdv2NFEsDTeMA6N8AMnjd+Dd/Xi9HUSCGHChDfKIr0tlYxO2jVdDzu5BWMhJsuDJ7KKgXQbR0PhKqpbZv9b0vJ/peBBLAdP8nNZf5pzllhc7ViZI+dAAGIf4olX0XobMN4q0r/kssSBgZr7XkiuvCm6yfGsaJzfeJDYXHLIZaG9KZSVtbzIWTkZvhfwDplfnrNaj1VXVGL39NU1lL7b/PYgvXs9LNBJxuOd/Z/jwtoLLTN49V3Mwaj3KmG631izLchx0xbbx+iKm/JWNkpMd8LSszkmWKtjz91xI03sUv0SLart7FK+gZK/S3mQgsR3IYsGEqXW9+nZ9sMHSKXz4g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tQucM-0000Uh-9H for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2024 15:38: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:38: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.17352454741880 (code B ref 75065); Thu, 26 Dec 2024 20:38:02 +0000 Original-Received: (at 75065) by debbugs.gnu.org; 26 Dec 2024 20:37:54 +0000 Original-Received: from localhost ([127.0.0.1]:42365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQucD-0000UG-W0 for submit@debbugs.gnu.org; Thu, 26 Dec 2024 15:37:54 -0500 Original-Received: from forward500d.mail.yandex.net ([178.154.239.208]:37802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQucB-0000Tu-I4 for 75065@debbugs.gnu.org; Thu, 26 Dec 2024 15:37:52 -0500 Original-Received: from mail-nwsmtp-smtp-production-main-39.klg.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-39.klg.yp-c.yandex.net [IPv6:2a02:6b8:c42:504a:0:640:b25:0]) by forward500d.mail.yandex.net (Yandex) with ESMTPS id 69620614C4; Thu, 26 Dec 2024 23:37:34 +0300 (MSK) Original-Received: by mail-nwsmtp-smtp-production-main-39.klg.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id VbgwvMXOpGk0-aPuCDV75; Thu, 26 Dec 2024 23:37:33 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1735245453; bh=GSHJoO6flt9wZu0YtI37csXjBuyNQJcO4u71zk0Ejnk=; h=References:Date:In-Reply-To:Cc:To:From:Subject:Message-ID; b=TIQyQJbZQUlHVjRMmg3FNDP6LJLbC0NIuJcx1/mjokkVkx8lIdLcmwd/RGJkQXT80 JAAlV0HfoB1qI16Nj5p5yVpmbcsPTs/VKtU9oQS0HrZTfi/AJDMGO3TVtEQjnFgw1G 3cYAV4+toH28yqSWQeT3Py/S1lxcfIOuqo0XXJqY= Authentication-Results: mail-nwsmtp-smtp-production-main-39.klg.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:297786 Archived-At: On Thu, 2024-12-26 at 20:32 +0000, Stefan Kangas wrote: > Konstantin Kharlamov writes: >=20 > > 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--down= load-one-archive archive "archive- > > > > > > contents" async) > > > > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (error (message "Failed to down= load `%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 down= load `%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)))))) > > > > > >=20 > > > > > Stefan and Philip, is this okay to install? > > >=20 > > > I agree with the idea behind the patch, but printing just `(cdr > > > err)` > > > doesn't seem right, it should print the whole of `err`. > >=20 > > The `car` seems to just contain word error. Here's how both > > compare: > >=20 > > =E2=80=A2 current patch with `(cdr err)`: > > =C2=A0=C2=A0=C2=A0 Failed to download =E2=80=98melpa=E2=80=99 archive. = Error: ("Location > > melpa.org/packages/ is not a url nor an absolute file name") > >=20 > > =E2=80=A2 suggested change with `err`: > > =C2=A0=C2=A0=C2=A0 Failed to download =E2=80=98melpa=E2=80=99 archive. = Error: (error "Location > > melpa.org/packages/ is not a url nor an absolute file name") >=20 > The "Error:" part is redundant, so I think it could be shortened to > something like: >=20 > =C2=A0=C2=A0=C2=A0 Failed to download =E2=80=98melpa=E2=80=99 archive: Lo= cation melpa.org/packages/ > is > =C2=A0=C2=A0=C2=A0 not a url nor an absolute file name Please note that in the above examples everything after the word `Error: ` is taken from the exception message, which includes the parentheses and (if I follow Stefan's advice) the downcased word "error". The reason in my patch I used `Error:` is because I have no control over the text that will follow, so I need to make sure it's clear that what follows is an error message. Hence my question to Stefan above: if the downcase word `error` will always be there, then removing `Error:` and replacing `(cdr err)` with `err` will works just as well.