mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
ui: Do not call 'display-error' for SRFI-34 exceptions.
* guix/ui.scm (report-load-error, warn-about-load-error, read/eval): Add clause for SRFI-34 exceptions.
This commit is contained in:
parent
97c15a297d
commit
23185ceadc
1 changed files with 7 additions and 0 deletions
|
@ -229,6 +229,8 @@ (define* (report-load-error file args #:optional frame)
|
|||
(let ((loc (source-properties->location properties)))
|
||||
(format (current-error-port) (_ "~a: error: ~a~%")
|
||||
(location->string loc) message)))
|
||||
(('srfi-34 obj)
|
||||
(report-error (_ "exception thrown: ~s~%") obj))
|
||||
((error args ...)
|
||||
(report-error (_ "failed to load '~a':~%") file)
|
||||
(apply display-error frame (current-error-port) args))))
|
||||
|
@ -244,6 +246,9 @@ (define (warn-about-load-error file args) ;FIXME: factorize with ↑
|
|||
(let ((loc (source-properties->location properties)))
|
||||
(format (current-error-port) (_ "~a: warning: ~a~%")
|
||||
(location->string loc) message)))
|
||||
(('srfi-34 obj)
|
||||
(warning (_ "failed to load '~a': exception thrown: ~s~%")
|
||||
file obj))
|
||||
((error args ...)
|
||||
(warning (_ "failed to load '~a':~%") file)
|
||||
(apply display-error #f (current-error-port) args))))
|
||||
|
@ -450,6 +455,8 @@ (define (read/eval str)
|
|||
(match args
|
||||
(('syntax-error proc message properties form . rest)
|
||||
(report-error (_ "syntax error: ~a~%") message))
|
||||
(('srfi-34 obj)
|
||||
(report-error (_ "exception thrown: ~s~%") obj))
|
||||
((error args ...)
|
||||
(apply display-error #f (current-error-port) args))
|
||||
(what? #f))
|
||||
|
|
Loading…
Reference in a new issue