GNU bug report logs -
#52555
[RFC PATCH 0/3] Decentralized substitute distribution with ERIS
Previous Next
Full log
Message #130 received at 52555 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
pukkamustard schreef op wo 02-02-2022 om 10:28 [+0000]:
> > pukkamustard schreef op di 25-01-2022 om 19:21 [+0000]:
> > > +(define (ipfs-daemon-alive?)
> > > + "Attempt to connect to the IPFS daemon. Returns #t if the
> > > daemon is alive
> > > +and #f else."
> > > + (with-exception-handler
> > > + (const #f)
> > > + (lambda _
> > > + (let ((response _
> > > + (http-post (string-append (%ipfs-base-url)
> > > +
> > > "/api/v0/version"))))
> > > + (equal? 200 (response-code response))))
> > > + #:unwind? #t))
> >
> > This should preferably only be catching exceptions indicating that
> > the daemon is down (exceptions indicating 404s, or system-errors
> > indicating network errors, ...).
>
> Yes, I guess it could be checked a bit finer. But at the end if an
> exception happens then the IPFS daemon is probably not reachable,
> right?
> If we don't care about the reason why it is not reachable then why
> bother with catching finer grained exceptions?
The exception could be caused by, say:
* an unbound variable
* wrong arity
* type error
* stack overflow
* prompt tag does not exist in current environment
* out of memory
Except for the last one, these causes are all bugs and hence shouldn't
be surpressed. Granted, this is a bit unlikely since this use of
'http-post' is very simple, but it's far from impossible for
(web client) to have a bug.
Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 1 year and 168 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.