Skip to content
Snippets Groups Projects
Unverified Commit aa1e73a9 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

guix system: Properly report Shepherd errors when upgrading services.

Fixes regression introduced in 8bf92e39.
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.
parent e8b652d4
No related branches found
No related tags found
No related merge requests found
...@@ -236,11 +236,15 @@ (define-syntax-rule (warn-on-system-error body ...) ...@@ -236,11 +236,15 @@ (define-syntax-rule (warn-on-system-error body ...)
(with-monad %store-monad (with-monad %store-monad
(return #f))))) (return #f)))))
(define-syntax-rule (with-shepherd-error-handling body ...) (define-syntax-rule (with-shepherd-error-handling mbody ...)
(warn-on-system-error "Catch and report Shepherd errors that arise when binding MBODY, a monadic
(guard (c ((shepherd-error? c) expression in %STORE-MONAD."
(report-shepherd-error c))) (lambda (store)
body ...))) (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) (define (report-shepherd-error error)
"Report ERROR, a '&shepherd-error' error condition object." "Report ERROR, a '&shepherd-error' error condition object."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment