me
/
guix
Archived
1
0
Fork 0

import: pypi: Use 'with-error-handling'.

* guix/scripts/import/pypi.scm (guix-import-pypi): Wrap body in
'with-error-handling'.
master
Ludovic Courtès 2022-02-02 15:53:55 +01:00
parent 2178692c93
commit 31ca569ca5
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 19 additions and 18 deletions

View File

@ -85,6 +85,7 @@ Import and convert the PyPI package for PACKAGE-NAME.\n"))
(reverse opts)))) (reverse opts))))
(match args (match args
((spec) ((spec)
(with-error-handling
(let ((name version (package-name->name+version spec))) (let ((name version (package-name->name+version spec)))
(if (assoc-ref opts 'recursive) (if (assoc-ref opts 'recursive)
;; Recursive import ;; Recursive import
@ -99,7 +100,7 @@ Import and convert the PyPI package for PACKAGE-NAME.\n"))
(unless sexp (unless sexp
(leave (G_ "failed to download meta-data for package '~a'~%") (leave (G_ "failed to download meta-data for package '~a'~%")
name)) name))
sexp)))) sexp)))))
(() (()
(leave (G_ "too few arguments~%"))) (leave (G_ "too few arguments~%")))
((many ...) ((many ...)