From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54290) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dAiSw-0004MI-83 for guix-patches@gnu.org; Tue, 16 May 2017 15:49:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dAiSs-0003Li-6Z for guix-patches@gnu.org; Tue, 16 May 2017 15:49:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:46435) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dAiSs-0003Lb-2d for guix-patches@gnu.org; Tue, 16 May 2017 15:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dAiSr-0000WX-PN for guix-patches@gnu.org; Tue, 16 May 2017 15:49:01 -0400 Subject: bug#26373: [PATCH 6/6] import cran: Skip updating when meta data cannot be downloaded. Resent-To: guix-patches@gnu.org Resent-Message-ID: References: <20170405164210.29428-1-rekado@elephly.net> <20170405164210.29428-6-rekado@elephly.net> <87efx0egd6.fsf@gnu.org> <87k26s1i5q.fsf@elephly.net> <8737dgeyg6.fsf@gnu.org> From: Ricardo Wurmus In-reply-to: <8737dgeyg6.fsf@gnu.org> Date: Tue, 16 May 2017 21:48:16 +0200 Message-ID: <87shk4a8hr.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 26373-done@debbugs.gnu.org Ludovic Courtès writes: > Ricardo Wurmus skribis: > >> Ludovic Courtès writes: >> >>> Ricardo Wurmus 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? >> >> I don’t know what the desired behaviour here is. When updating >> packages, I think it’s good to keep going. If there’s an error >> downloading the package meta data I want “meta” to be “#f”, which leads >> to skipping the update. >> >> Without turning errors to “#f” I wasn’t able to just update all packages >> with “guix refresh -t cran,bioconductor -u”. > > What was the exception? > > I think a good approach is to catch precisely the kind of error that we > don’t want to see. ‘false-if-exception’ catches everything and could > thus hide genuine errors/bugs (including unbound variables and similar), > which sounds undesirable. > > WDYT? I don’t remember why I wanted this, so I didn’t push this patch. I agree that it’s much better to catch errors precisely. Thanks for the review! I pushed all the other patches (with the exception of one that Mathieu had already implemented independently) to master. -- Ricardo GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC https://elephly.net