guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: import: json: Handle the error case.


From: Danny Milosavljevic
Subject: 01/01: import: json: Handle the error case.
Date: Tue, 16 Oct 2018 17:18:19 -0400 (EDT)

dannym pushed a commit to branch master
in repository guix.

commit ad0082afe041af1a6e8e8f04415fdcae23e8fc0f
Author: Danny Milosavljevic <address@hidden>
Date:   Tue Oct 16 14:35:41 2018 +0200

    import: json: Handle the error case.
    
    * guix/import/json.scm (json-fetch-alist): Handle the error case.
---
 guix/import/json.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/guix/import/json.scm b/guix/import/json.scm
index 4f96a51..81ea5e7 100644
--- a/guix/import/json.scm
+++ b/guix/import/json.scm
@@ -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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]