From: Konstantin Kharlamov <Hi-Angel@yandex.ru>
To: Stefan Kangas <stefankangas@gmail.com>,
Stefan Monnier <monnier@iro.umontreal.ca>,
Philip Kaludercic <philipk@posteo.net>
Cc: 75065@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>
Subject: bug#75065: Upon archive download failure print the original error
Date: Thu, 26 Dec 2024 23:37:31 +0300 [thread overview]
Message-ID: <ed6c8372b6b482df60d5a718db9b1c155766510f.camel@yandex.ru> (raw)
In-Reply-To: <CADwFkmn1tqUBnMS7SG0KMfejUMHAWJHCo8vzWvaT0Gycj6Opxg@mail.gmail.com>
On Thu, 2024-12-26 at 20:32 +0000, Stefan Kangas wrote:
> Konstantin Kharlamov <Hi-Angel@yandex.ru> writes:
>
> > On Thu, 2024-12-26 at 14:17 -0500, Stefan Monnier wrote:
> > > > > > (dolist (archive package-archives)
> > > > > > - (condition-case-unless-debug nil
> > > > > > + (condition-case-unless-debug err
> > > > > > (package--download-one-archive archive "archive-
> > > > > > contents" async)
> > > > > > - (error (message "Failed to download `%s' archive."
> > > > > > - (car archive))))))
> > > > > > + (error (message "Failed to download `%s' archive.
> > > > > > Error:
> > > > > > %S"
> > > > > > + (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:
> >
> > • current patch with `(cdr err)`:
> > Failed to download ‘melpa’ archive. Error: ("Location
> > melpa.org/packages/ is not a url nor an absolute file name")
> >
> > • suggested change with `err`:
> > Failed to download ‘melpa’ archive. Error: (error "Location
> > melpa.org/packages/ is not a url nor an absolute file name")
>
> The "Error:" part is redundant, so I think it could be shortened to
> something like:
>
> Failed to download ‘melpa’ archive: Location melpa.org/packages/
> is
> 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.
next prev parent reply other threads:[~2024-12-26 20:37 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-24 15:25 bug#75065: Upon archive download failure print the original error Konstantin Kharlamov
2024-12-26 8:55 ` Eli Zaretskii
2024-12-26 18:13 ` Philip Kaludercic
2024-12-26 18:17 ` Konstantin Kharlamov
2024-12-26 18:31 ` Philip Kaludercic
2024-12-26 19:17 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-26 20:14 ` Konstantin Kharlamov
2024-12-26 20:32 ` Stefan Kangas
2024-12-26 20:37 ` Konstantin Kharlamov [this message]
2024-12-26 20:40 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-26 20:51 ` Konstantin Kharlamov
2024-12-26 20:53 ` Konstantin Kharlamov
2024-12-26 21:03 ` Konstantin Kharlamov
2024-12-27 7:22 ` Eli Zaretskii
2024-12-27 17:01 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-27 18:34 ` Konstantin Kharlamov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ed6c8372b6b482df60d5a718db9b1c155766510f.camel@yandex.ru \
--to=hi-angel@yandex.ru \
--cc=75065@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=philipk@posteo.net \
--cc=stefankangas@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).