From: Lars Ingebrigtsen <larsi@gnus.org>
To: Eric Abrahamsen <eric@ericabrahamsen.net>
Cc: info-gnus-english@gnu.org
Subject: Re: Mail source unreachable - continue yes/no?
Date: Thu, 14 Oct 2021 13:22:26 +0200 [thread overview]
Message-ID: <87czo7zw99.fsf@gnus.org> (raw)
In-Reply-To: <87bl3srye4.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Wed, 13 Oct 2021 22:03:31 -0700")
Eric Abrahamsen <eric@ericabrahamsen.net> writes:
> On second thought you're not wrong here: the various *-open-server
> deffoos report their own failures with `nnheader-report' instead of
> signaling errors, and then `gnus-open-server' swallows any other errors
> and converts them to messages.
Ah. I knew there was something like that somewhere. :-)
> Failures arrived at via `gnus-request-scan' mostly show up as actual
> errors.
Perhaps we should adjust those errors to be nnheader-report thingies
instead?
> - When the gnus-open-server deffoo processes fail, they (or their
> downstream functions) signal 'gnus-server-connection-error. (I didn't
> go through and do this for every backend, just enough to get the
> idea.)
> - Mail source fetching can fail, in which case 'gnus-mail-source-error
> is signaled. nnmail.el no longer handles this error: it propagates up
> and out through gnus-request-scan.
I've just skimmed the patch, but the approach looks sound to me (in
general).
> Some observations and questions:
>
> - There are many places and depth-levels in Gnus where failure modes are
> dealt with as messages (in effect working like `with-demoted-errors')
> or as nil return values from functions, which are then converted into
> messages, or sometimes even re-signaled as an actual `error' with a
> new message string. This often ends up burying real errors, and/or
> making debug on error hard to use. We could try flattening this out:
> low-level functions signal errors, and only top-level functions in
> gnus-start/gnus-group/gnus-sum get to catch them at the last minute,
> and only if necessary (other layers can of course catch and re-signal
> the errors if some cleanup work needs to be done). I have no idea if
> this would end up working out, but I think it would be good to try.
> And more use of `condition-case-unless-debug' at the top level.
I doubt it's possible to find an overarching strategy to handle all
kinds of errors on the "Gnus" level. Different errors are, well,
different.
> - There are many ways of logging, and messaging the user. Apart from
> `message' itself, there's `nnheader-report', `gnus-backend-trace',
> `nnheader-message(-maybe)', `gnus-message' and its action message log,
> along with `gnus-final-warning' and `gnus-error'.
>
> nnheader-report, in particular, seems to often be used as a substitute
> for actually signaling an error. A server is asked to do something, it
> fails for some reason and logs the reason with nnheader-report, then
> returns nil. The caller sees the nil, then retrieves the string with
> nnheader-get-report, and uses it to signal an error.
Hey! I invented Go error handling decades before Go was invented!
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
next prev parent reply other threads:[~2021-10-14 11:22 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-11 6:07 Lars-Johan Liman
2021-10-12 12:39 ` Lars Ingebrigtsen
2021-10-12 16:50 ` Eric Abrahamsen
2021-10-12 16:57 ` Lars Ingebrigtsen
2021-10-12 17:49 ` Eric Abrahamsen
2021-10-12 17:56 ` Lars Ingebrigtsen
2021-10-12 18:18 ` Eric Abrahamsen
2021-10-12 18:25 ` Lars Ingebrigtsen
2021-10-12 19:50 ` Eric Abrahamsen
2021-10-13 11:33 ` Lars Ingebrigtsen
2021-10-14 5:03 ` Eric Abrahamsen
2021-10-14 11:22 ` Lars Ingebrigtsen [this message]
2021-10-14 18:31 ` Eric Abrahamsen
2021-10-15 10:42 ` Lars Ingebrigtsen
2021-10-15 17:43 ` Eric Abrahamsen
2021-10-12 16:57 ` Lars-Johan Liman
2021-10-14 17:39 ` Eric Abrahamsen
2021-10-15 10:48 ` Lars Ingebrigtsen
2021-10-15 17:52 ` Eric Abrahamsen
2021-10-18 6:42 ` Lars Ingebrigtsen
2021-10-18 15:03 ` Eric Abrahamsen
2021-10-19 13:42 ` Lars Ingebrigtsen
2021-10-19 15:15 ` Eric Abrahamsen
2021-10-21 23:36 ` Eric Abrahamsen
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87czo7zw99.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=eric@ericabrahamsen.net \
--cc=info-gnus-english@gnu.org \
/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.
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 NNTP newsgroup(s).