guix system: Properly report Shepherd errors when upgrading services.
Fixes regression introduced in 8bf92e3904
.
Reported by myglc2 <myglc2@gmail.com> in <http://bugs.gnu.org/24135>.
* guix/scripts/system.scm (with-shepherd-error-handling): Rename 'body'
to 'mbody'. Expand to a monadic procedure that runs MBODY.
This commit is contained in:
parent
e8b652d46b
commit
aa1e73a996
|
@ -236,11 +236,15 @@ BODY..., and restore them."
|
|||
(with-monad %store-monad
|
||||
(return #f)))))
|
||||
|
||||
(define-syntax-rule (with-shepherd-error-handling body ...)
|
||||
(warn-on-system-error
|
||||
(guard (c ((shepherd-error? c)
|
||||
(report-shepherd-error c)))
|
||||
body ...)))
|
||||
(define-syntax-rule (with-shepherd-error-handling mbody ...)
|
||||
"Catch and report Shepherd errors that arise when binding MBODY, a monadic
|
||||
expression in %STORE-MONAD."
|
||||
(lambda (store)
|
||||
(warn-on-system-error
|
||||
(guard (c ((shepherd-error? c)
|
||||
(report-shepherd-error c)))
|
||||
(values (run-with-store store (begin mbody ...))
|
||||
store)))))
|
||||
|
||||
(define (report-shepherd-error error)
|
||||
"Report ERROR, a '&shepherd-error' error condition object."
|
||||
|
|
Loading…
Reference in New Issue