import: json: Handle the error case.

* guix/import/json.scm (json-fetch-alist): Handle the error case.
This commit is contained in:
Danny Milosavljevic 2018-10-16 14:35:41 +02:00
parent 02d5ed4a27
commit ad0082afe0
No known key found for this signature in database
GPG key ID: E71A35542C30BAA5

View file

@ -47,4 +47,5 @@ (define* (json-fetch url
(define (json-fetch-alist url)
"Return an alist representation of the JSON resource URL, or #f if URL
returns 403 or 404."
(hash-table->alist (json-fetch url)))
(and=> (json-fetch url)
hash-table->alist))