offload: Remove 'with-nar-error-handling' macro.

* guix/scripts/offload.scm (with-nar-error-handling): Remove.
(guix-offload): Use 'with-error-handling' instead.
This commit is contained in:
Ludovic Courtès 2016-11-05 00:46:04 +01:00
parent 6230d6f04f
commit e8a5db80d5
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 1 additions and 12 deletions

View File

@ -664,17 +664,6 @@ defines a total order on machines.)"
;; Not now, all the machines are busy.
(display "# postpone\n")))))))
(define-syntax-rule (with-nar-error-handling body ...)
"Execute BODY with any &nar-error suitably reported to the user."
(guard (c ((nar-error? c)
(let ((file (nar-error-file c)))
(if (condition-has-type? c &message)
(leave (_ "while importing file '~a': ~a~%")
file (gettext (condition-message c)))
(leave (_ "failed to import file '~a'~%")
file)))))
body ...))
;;;
;;; Entry point.
@ -705,7 +694,7 @@ defines a total order on machines.)"
(cond ((regexp-exec request-line-rx line)
=>
(lambda (match)
(with-nar-error-handling
(with-error-handling
(process-request (equal? (match:substring match 1) "1")
(match:substring match 2) ; system
(call-with-input-file