diff options
author | Alex Kost <alezost@gmail.com> | 2014-10-08 17:29:01 +0400 |
---|---|---|
committer | Alex Kost <alezost@gmail.com> | 2014-10-12 08:45:37 +0400 |
commit | c0c018f1805d8410ffb1bc2abb1295ebbe55c38b (patch) | |
tree | fdc2cb3abd7b61eaf3b93b39552a71adc288430c /guix/ui.scm | |
parent | 1b7d5242c36d82242f1148cc583ea362d3e83577 (diff) | |
download | gnu-guix-c0c018f1805d8410ffb1bc2abb1295ebbe55c38b.tar gnu-guix-c0c018f1805d8410ffb1bc2abb1295ebbe55c38b.tar.gz |
profiles: Add condition types for profiles and generations.
Suggested by Ludovic Courtès.
* guix/profiles.scm (&profile-error, &profile-not-found-error,
&missing-generation-error): New condition types.
* guix/ui.scm (call-with-error-handling): Handle new types.
* guix/scripts/package.scm (roll-back, guix-package): Raise
'&profile-not-found-error' where needed.
Diffstat (limited to 'guix/ui.scm')
-rw-r--r-- | guix/ui.scm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/guix/ui.scm b/guix/ui.scm index 8c4a9d2d22..69b073da50 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org> +;;; Copyright © 2014 Alex Kost <alezost@gmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -231,6 +232,13 @@ interpreted." (location->string loc) (package-full-name package) (build-system-name system)))) + ((profile-not-found-error? c) + (leave (_ "profile '~a' does not exist~%") + (profile-error-profile c))) + ((missing-generation-error? c) + (leave (_ "generation ~a of profile '~a' does not exist~%") + (missing-generation-error-generation c) + (profile-error-profile c))) ((nix-connection-error? c) (leave (_ "failed to connect to `~a': ~a~%") (nix-connection-error-file c) |