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.
master
Ludovic Courtès 2014-04-04 20:37:27 +02:00
parent 2a58b1b024
commit bde8c0e6d9
1 changed files with 3 additions and 3 deletions

View File

@ -194,9 +194,9 @@ General help using GNU software: <http://www.gnu.org/gethelp/>"))
;; 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."