diff options
author | Ludovic Courtès <ludo@gnu.org> | 2014-03-17 23:47:18 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2014-03-17 23:47:18 +0100 |
commit | d0a850698a947ac5c59c99980391a12abad82385 (patch) | |
tree | 3f59789895d9caeabdc74a2e7e1bdc146d4e292e | |
parent | aa2480e50d713b90805336ab48477ba596aef531 (diff) | |
download | gnu-guix-d0a850698a947ac5c59c99980391a12abad82385.tar gnu-guix-d0a850698a947ac5c59c99980391a12abad82385.tar.gz |
guix archive: Improve '--generate-key' error reporting.
* guix/scripts/archive.scm (%options) <generate-key>: Report the error
source and string when 'string->canonical-sexp' fails.
-rw-r--r-- | guix/scripts/archive.scm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/guix/scripts/archive.scm b/guix/scripts/archive.scm index 0ab7686585..f513f33dd4 100644 --- a/guix/scripts/archive.scm +++ b/guix/scripts/archive.scm @@ -114,9 +114,10 @@ Export/import one or more packages from/to the store.\n")) (string->canonical-sexp (or arg "(genkey (rsa (nbits 4:4096)))")))) (alist-cons 'generate-key params result))) - (lambda args - (leave (_ "invalid key generation parameters: ~s~%") - arg))))) + (lambda (key err) + (leave (_ "invalid key generation parameters: ~a: ~a~%") + (error-source err) + (error-string err)))))) (option '("authorize") #f #f (lambda (opt name arg result) (alist-cons 'authorize #t result))) |