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/profiles.scm | |
parent | 1b7d5242c36d82242f1148cc583ea362d3e83577 (diff) | |
download | guix-c0c018f1805d8410ffb1bc2abb1295ebbe55c38b.tar 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/profiles.scm')
-rw-r--r-- | guix/profiles.scm | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/guix/profiles.scm b/guix/profiles.scm index f2eb754bca..793af2463f 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -34,7 +34,18 @@ #:use-module (srfi srfi-11) #:use-module (srfi srfi-19) #:use-module (srfi srfi-26) - #:export (manifest make-manifest + #:use-module (srfi srfi-34) + #:use-module (srfi srfi-35) + #:export (&profile-error + profile-error? + profile-error-profile + &profile-not-found-error + profile-not-found-error? + &missing-generation-error + missing-generation-error? + missing-generation-error-generation + + manifest make-manifest manifest? manifest-entries @@ -82,6 +93,22 @@ ;;; +;;; Condition types. +;;; + +(define-condition-type &profile-error &error + profile-error? + (profile profile-error-profile)) + +(define-condition-type &profile-not-found-error &profile-error + profile-not-found-error?) + +(define-condition-type &missing-generation-error &profile-error + missing-generation-error? + (generation missing-generation-error-generation)) + + +;;; ;;; Manifests. ;;; |