From 3e43166ffc11fb117c55da594e57866a75625900 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 3 Apr 2017 23:52:19 +0200 Subject: gexp: 'lower-object' raises an exception when passed an invalid object. * guix/gexp.scm (&gexp-error, &gexp-input-error): New error conditions. (lower-object): Raise &gexp-input-error when 'lookup-compiler' returns #f. * tests/gexp.scm ("lower-object & gexp-input-error?"): New test. * guix/ui.scm (call-with-error-handling): Add case for 'gexp-input-error?'. --- guix/ui.scm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'guix/ui.scm') diff --git a/guix/ui.scm b/guix/ui.scm index 345bf490b2..b3c94795fe 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -26,6 +26,7 @@ ;;; along with GNU Guix. If not, see . (define-module (guix ui) + #:use-module (guix gexp) #:use-module (guix utils) #:use-module (guix store) #:use-module (guix config) @@ -448,6 +449,10 @@ interpreted." (location->string loc) (package-full-name package) (build-system-name system)))) + ((gexp-input-error? c) + (let ((input (package-error-invalid-input c))) + (leave (_ "~s: invalid G-expression input~%") + (gexp-error-invalid-input c)))) ((profile-not-found-error? c) (leave (_ "profile '~a' does not exist~%") (profile-error-profile c))) -- cgit v1.2.3