mirror of
https://codeberg.org/guix/guix.git
synced 2026-01-25 03:55:08 -06:00
authenticate: Improve error replies.
* guix/scripts/authenticate.scm (guix-authenticate)[send-reply]: Wrap guard in ‘with-fluids’. Call ‘string-trim-right’ on the message string of ‘c’. Change-Id: I6ab5f645f2dc9d6f53bb57eabb4de1df8212892f Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
ce279acd14
commit
5d6dfd8981
1 changed files with 8 additions and 4 deletions
|
|
@ -161,10 +161,14 @@ by colon, followed by the given number of characters."
|
|||
;; Send a reply for the result of THUNK or for any exception raised during
|
||||
;; its execution.
|
||||
(guard (c ((formatted-message? c)
|
||||
(send-reply (reply-code command-failed)
|
||||
(apply format #f
|
||||
(G_ (formatted-message-string c))
|
||||
(formatted-message-arguments c)))))
|
||||
;; Make sure the translated message can be written to standard
|
||||
;; output as ISO-8859-1 no matter what (XXX).
|
||||
(with-fluids ((%default-port-conversion-strategy 'substitute))
|
||||
(send-reply (reply-code command-failed)
|
||||
(apply format #f
|
||||
(string-trim-right
|
||||
(G_ (formatted-message-string c)))
|
||||
(formatted-message-arguments c))))))
|
||||
(send-reply (reply-code success) (thunk))))
|
||||
|
||||
(define-syntax-rule (with-reply exp ...)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue