From d0a850698a947ac5c59c99980391a12abad82385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 17 Mar 2014 23:47:18 +0100 Subject: guix archive: Improve '--generate-key' error reporting. * guix/scripts/archive.scm (%options) : Report the error source and string when 'string->canonical-sexp' fails. --- guix/scripts/archive.scm | 7 ++++--- 1 file 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))) -- cgit v1.2.3