guix system: Clarify what happens where service upgrade fails.
* guix/scripts/system.scm (report-shepherd-error): Use 'warning' instead of 'report-error'. Add extra 'warning' and 'display-hint' calls.
This commit is contained in:
parent
a4e81ff325
commit
7e90e28a15
1 changed files with 26 additions and 21 deletions
|
@ -271,15 +271,16 @@ expression in %STORE-MONAD."
|
||||||
|
|
||||||
(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."
|
||||||
|
(when error
|
||||||
(cond ((service-not-found-error? error)
|
(cond ((service-not-found-error? error)
|
||||||
(report-error (G_ "service '~a' could not be found~%")
|
(warning (G_ "service '~a' could not be found~%")
|
||||||
(service-not-found-error-service error)))
|
(service-not-found-error-service error)))
|
||||||
((action-not-found-error? error)
|
((action-not-found-error? error)
|
||||||
(report-error (G_ "service '~a' does not have an action '~a'~%")
|
(warning (G_ "service '~a' does not have an action '~a'~%")
|
||||||
(action-not-found-error-service error)
|
(action-not-found-error-service error)
|
||||||
(action-not-found-error-action error)))
|
(action-not-found-error-action error)))
|
||||||
((action-exception-error? error)
|
((action-exception-error? error)
|
||||||
(report-error (G_ "exception caught while executing '~a' \
|
(warning (G_ "exception caught while executing '~a' \
|
||||||
on service '~a':~%")
|
on service '~a':~%")
|
||||||
(action-exception-error-action error)
|
(action-exception-error-action error)
|
||||||
(action-exception-error-service error))
|
(action-exception-error-service error))
|
||||||
|
@ -287,12 +288,16 @@ on service '~a':~%")
|
||||||
(action-exception-error-key error)
|
(action-exception-error-key error)
|
||||||
(action-exception-error-arguments error)))
|
(action-exception-error-arguments error)))
|
||||||
((unknown-shepherd-error? error)
|
((unknown-shepherd-error? error)
|
||||||
(report-error (G_ "something went wrong: ~s~%")
|
(warning (G_ "something went wrong: ~s~%")
|
||||||
(unknown-shepherd-error-sexp error)))
|
(unknown-shepherd-error-sexp error)))
|
||||||
((shepherd-error? error)
|
((shepherd-error? error)
|
||||||
(report-error (G_ "shepherd error~%")))
|
(warning (G_ "shepherd error~%"))))
|
||||||
((not error) ;not an error
|
|
||||||
#t)))
|
;; Don't leave users out in the cold and explain what that means and what
|
||||||
|
;; they can do.
|
||||||
|
(warning (G_ "some services could not be upgraded~%"))
|
||||||
|
(display-hint (G_ "To allow changes to all the system services to take
|
||||||
|
effect, you will need to reboot."))))
|
||||||
|
|
||||||
(define-syntax-rule (unless-file-not-found exp)
|
(define-syntax-rule (unless-file-not-found exp)
|
||||||
(catch 'system-error
|
(catch 'system-error
|
||||||
|
|
Reference in a new issue