import: elpa: Fix call-with-downloaded-file

* guix/import/elpa.scm (call-with-downloaded-file): Make function behaviour
match documentation string.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Carlo Zancanaro 2016-12-14 12:31:12 +11:00 committed by Ludovic Courtès
parent d835c6cc4b
commit 36225d4fef
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 7 additions and 1 deletions

View File

@ -89,7 +89,13 @@ NAMES (strings)."
"Fetch URL, store the content in a temporary file and call PROC with that
file. Returns the value returned by PROC. On error call ERROR-THUNK and
return its value or leave if it's false."
(proc (http-fetch/cached (string->uri url))))
(catch #t
(lambda ()
(proc (http-fetch/cached (string->uri url))))
(lambda (key . args)
(if error-thunk
(error-thunk)
(leave (_ "~A: download failed~%") url)))))
(define (is-elpa-package? name elpa-pkg-spec)
"Return true if the string NAME corresponds to the name of the package