import: json: Handle the error case.
authorDanny Milosavljevic <dannym@scratchpost.org>
Tue, 16 Oct 2018 12:35:41 +0000 (14:35 +0200)
committerDanny Milosavljevic <dannym@scratchpost.org>
Tue, 16 Oct 2018 21:17:36 +0000 (23:17 +0200)
* guix/import/json.scm (json-fetch-alist): Handle the error case.

guix/import/json.scm

index 4f96a51..81ea5e7 100644 (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))