From c0c018f1805d8410ffb1bc2abb1295ebbe55c38b Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Wed, 8 Oct 2014 17:29:01 +0400 Subject: profiles: Add condition types for profiles and generations. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- guix/ui.scm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'guix/ui.scm') 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 ;;; Copyright © 2013 Mark H Weaver ;;; Copyright © 2013 Nikita Karetnikov +;;; Copyright © 2014 Alex Kost ;;; ;;; 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) -- cgit v1.2.3