guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/02: deploy: Gracefully handle errors.


From: guix-commits
Subject: 01/02: deploy: Gracefully handle errors.
Date: Thu, 30 Jul 2020 13:18:38 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit c9c8c6331e51097652a28538ad3bd06e9ddac5c0
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Thu Jul 30 11:17:51 2020 +0200

    deploy: Gracefully handle errors.
    
    * guix/scripts/deploy.scm (guix-deploy): Wrap body in 'with-error-handling'.
---
 guix/scripts/deploy.scm | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/guix/scripts/deploy.scm b/guix/scripts/deploy.scm
index 4466a0c..09ad63c 100644
--- a/guix/scripts/deploy.scm
+++ b/guix/scripts/deploy.scm
@@ -140,18 +140,19 @@ Perform the deployment specified by FILE.\n"))
   (define (handle-argument arg result)
     (alist-cons 'file arg result))
 
-  (let* ((opts (parse-command-line args %options (list %default-options)
-                                   #:argument-handler handle-argument))
-         (file (assq-ref opts 'file))
-         (machines (or (and file (load-source-file file)) '())))
-    (show-what-to-deploy machines)
-
-    (with-status-verbosity (assoc-ref opts 'verbosity)
-      (with-store store
-        (set-build-options-from-command-line store opts)
-        (with-build-handler (build-notifier #:use-substitutes?
-                                            (assoc-ref opts 'substitutes?))
-          (parameterize ((%graft? (assq-ref opts 'graft?)))
-            (map/accumulate-builds store
-                                   (cut deploy-machine* store <>)
-                                   machines)))))))
+  (with-error-handling
+    (let* ((opts (parse-command-line args %options (list %default-options)
+                                     #:argument-handler handle-argument))
+           (file (assq-ref opts 'file))
+           (machines (or (and file (load-source-file file)) '())))
+      (show-what-to-deploy machines)
+
+      (with-status-verbosity (assoc-ref opts 'verbosity)
+        (with-store store
+          (set-build-options-from-command-line store opts)
+          (with-build-handler (build-notifier #:use-substitutes?
+                                              (assoc-ref opts 'substitutes?))
+            (parameterize ((%graft? (assq-ref opts 'graft?)))
+              (map/accumulate-builds store
+                                     (cut deploy-machine* store <>)
+                                     machines))))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]