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
1 changed files with 2 additions and 1 deletions

View File

@ -47,4 +47,5 @@ the query."
(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))