mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
ui: Properly report '&nar-error' conditions.
This is a followup to 46b8aad
.
* guix/ui.scm (call-with-error-handling): Add 'nar-error?' case.
This commit is contained in:
parent
0919f5f466
commit
b7071bc5bb
1 changed files with 10 additions and 1 deletions
11
guix/ui.scm
11
guix/ui.scm
|
@ -25,8 +25,9 @@ (define-module (guix ui)
|
|||
#:use-module (guix config)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix profiles)
|
||||
#:use-module (guix build-system)
|
||||
#:use-module (guix derivations)
|
||||
#:use-module (guix build-system)
|
||||
#:use-module (guix serialization)
|
||||
#:use-module ((guix build utils) #:select (mkdir-p))
|
||||
#:use-module ((guix licenses) #:select (license? license-name))
|
||||
#:use-module (srfi srfi-1)
|
||||
|
@ -241,6 +242,14 @@ (define (call-with-error-handling thunk)
|
|||
(leave (_ "generation ~a of profile '~a' does not exist~%")
|
||||
(missing-generation-error-generation c)
|
||||
(profile-error-profile c)))
|
||||
((nar-error? c)
|
||||
(let ((file (nar-error-file c))
|
||||
(port (nar-error-port c)))
|
||||
(if file
|
||||
(leave (_ "corrupt input while restoring '~a' from ~s~%")
|
||||
file (or (port-filename port) port))
|
||||
(leave (_ "corrupt input while restoring archive from ~s~%")
|
||||
(or (port-filename port) port)))))
|
||||
((nix-connection-error? c)
|
||||
(leave (_ "failed to connect to `~a': ~a~%")
|
||||
(nix-connection-error-file c)
|
||||
|
|
Loading…
Reference in a new issue