git: Add an exception printer for 'git-error'.

* guix/git.scm (print-git-error): New procedure.
<top level>: Call 'set-exception-printer!'.
master
Ludovic Courtès 2019-02-11 22:51:08 +01:00
parent 70a50305c4
commit 1d8b10d00f
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 8 additions and 0 deletions

View File

@ -300,6 +300,14 @@ Log progress and checkout info to LOG-PORT."
#:select? (negate dot-git?))
commit)))
(define (print-git-error port key args default-printer)
(match args
(((? git-error? error) . _)
(format port (G_ "Git error: ~a~%")
(git-error-message error)))))
(set-exception-printer! 'git-error print-git-error)
;;;
;;; Checkouts.