Subject: bug#26373: [PATCH 6/6] import cran: Skip updating when meta data cannot be downloaded.

From: [email-masked] (Ludovic Courtès)
Date: Mon, 10 Apr 2017 11:55:49 +0200

Ricardo Wurmus <[email-masked]> skribis:

> * gnu/packages/bioinformatics.scm (latest-cran-release,
> latest-bioconductor-release): Abort early when meta data cannot be downloaded.
> ---
>  guix/import/cran.scm | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/guix/import/cran.scm b/guix/import/cran.scm
> index 557d694ad..fc7a1ed84 100644
> --- a/guix/import/cran.scm
> +++ b/guix/import/cran.scm
> @@ -398,7 +398,8 @@ dependencies."
>      (package->upstream-name package))
>  
>    (define meta
> -    (fetch-description 'cran upstream-name))
> +    (false-if-exception
> +     (fetch-description 'cran upstream-name)))

I would prefer catching only the relevant exception.  So I suppose
something like:

  (guard (c ((http-get-error? c)
             (if (= 404 (http-get-error-code c))
                 #f
                 (raise c))))
    (fetch-description 'cran upstream-name))

However I see that ‘fetch-description’ already does that, so what
exceptions are we protecting against?

Thanks,
Ludo’.