guix system: Improve error messages.
* guix/ui.scm (report-error): Export. * guix/scripts/system.scm (read-operating-system): Report syntax errors using standard GNU format. Report other errors using 'display-error'.master
parent
fbb020451e
commit
70e629f548
|
@ -76,11 +76,14 @@
|
|||
file (strerror err))))
|
||||
(('syntax-error proc message properties form . rest)
|
||||
(let ((loc (source-properties->location properties)))
|
||||
(leave (_ "~a: ~a~%")
|
||||
(location->string loc) message)))
|
||||
(_
|
||||
(leave (_ "failed to load operating system file '~a': ~s~%")
|
||||
file args))))))
|
||||
(format (current-error-port) (_ "~a: error: ~a~%")
|
||||
(location->string loc) message)
|
||||
(exit 1)))
|
||||
((error args ...)
|
||||
(report-error (_ "failed to load operating system file '~a':~%")
|
||||
file)
|
||||
(apply display-error #f (current-error-port) args)
|
||||
(exit 1))))))
|
||||
|
||||
|
||||
;;;
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
#:export (_
|
||||
N_
|
||||
P_
|
||||
report-error
|
||||
leave
|
||||
show-version-and-exit
|
||||
show-bug-report-information
|
||||
|
|
Reference in New Issue