From ef86c39f27b0d1c21435ea54cba5fb247e341537 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 7 Mar 2013 19:29:12 +0100 Subject: ui: Gracefully report failures to connect to the daemon. * guix/store.scm (&nix-connection-error): New condition type. (open-connection): Translate `system-error' during the `connect' call into `&nix-connection-error'. * guix/ui.scm (call-with-error-handling): Add case for `nix-connection-error?'. * guix/scripts/package.scm (guix-package): Move `open-connection' call within `with-error-handling'. * guix/scripts/pull.scm (guix-pull): Likewise. * guix/scripts/download.scm (guix-download): Move body within `with-error-handling'. --- guix/scripts/pull.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'guix/scripts/pull.scm') diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index 942bf501c5..bc72dc4088 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -194,9 +194,9 @@ Download and deploy the latest version of Guix.\n")) (leave (_ "~A: unexpected argument~%") arg)) %default-options)) - (let ((opts (parse-options)) - (store (open-connection))) - (with-error-handling + (with-error-handling + (let ((opts (parse-options)) + (store (open-connection))) (let ((tarball (download-and-store store))) (unless tarball (leave (_ "failed to download up-to-date source, exiting\n"))) -- cgit v1.2.3