From 5a5e34e3588e863de0028523ada61041e78cf8c6 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 12 Jan 2018 22:51:41 +0100 Subject: offload: 'test' gracefully handles 'node-repl-error'. Fixes . Reported by Ricardo Wurmus . * guix/scripts/offload.scm (assert-node-has-guix): Catch 'node-repl-error' and call 'leave'. --- guix/scripts/offload.scm | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'guix/scripts/offload.scm') diff --git a/guix/scripts/offload.scm b/guix/scripts/offload.scm index 25efe90e79..aaad992289 100644 --- a/guix/scripts/offload.scm +++ b/guix/scripts/offload.scm @@ -551,18 +551,23 @@ (define (assert-node-repl node name) (define (assert-node-has-guix node name) "Bail out if NODE lacks the (guix) module, or if its daemon is not running." - (match (node-eval node - '(begin - (use-modules (guix)) - (with-store store - (add-text-to-store store "test" - "Hello, build machine!")))) - ((? string? str) - (info (G_ "Guix is usable on '~a' (test returned ~s)~%") - name str)) - (x - (leave (G_ "failed to use Guix module on '~a' (test returned ~s)~%") - name x)))) + (catch 'node-repl-error + (lambda () + (match (node-eval node + '(begin + (use-modules (guix)) + (with-store store + (add-text-to-store store "test" + "Hello, build machine!")))) + ((? string? str) + (info (G_ "Guix is usable on '~a' (test returned ~s)~%") + name str)) + (x + (leave (G_ "failed to use Guix module on '~a' (test returned ~s)~%") + name x)))) + (lambda (key . args) + (leave (G_ "remove evaluation on '~a' failed:~{ ~s~}~%") + args)))) (define %random-state (delay -- cgit v1.2.3