ui: Improve reporting of 'system-error' exceptions.

* guix/ui.scm (call-with-error-handling): Change 'system-error' handler
  to display the error message as it was raised.
This commit is contained in:
Ludovic Courtès 2014-04-04 20:37:27 +02:00
parent 2a58b1b024
commit bde8c0e6d9

View file

@ -194,9 +194,9 @@ (define (call-with-error-handling thunk)
;; Catch EPIPE and the likes.
(catch 'system-error
thunk
(lambda args
(leave (_ "~a~%")
(strerror (system-error-errno args)))))))
(lambda (key proc format-string format-args . rest)
(leave (_ "~a: ~a~%") proc
(apply format #f format-string format-args))))))
(define (read/eval str)
"Read and evaluate STR, raising an error if something goes wrong."