summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorYarl Baudig <yarl-baudig@mailoo.org>2026-03-28 12:19:54 +0100
committerLudovic Courtès <ludo@gnu.org>2026-03-29 22:11:38 +0200
commit785f4c6ed9b3e7a8ff31fe7a719848b7b14ad5dc (patch)
tree4f036a35068df45320b8e5b475a1b7beaa51fc17 /guix
parent1b08655ef8a7e99c5031b456dba1b6f86b9c5444 (diff)
gexp: improve &gexp-input-error with &error-location.
* guix/gexp.scm (gexp->sexp): raise &error-location along &gexp-input-error. * guix/ui.scm (call-with-error-handling): use this. * tests/gexp.scm (lower-gexp, invalid input location): New test. Change-Id: Iee761e5f99502065182d9e6fc8d21399e99ec6c3 Signed-off-by: Ludovic Courtès <ludo@gnu.org> Merges: #7538
Diffstat (limited to 'guix')
-rw-r--r--guix/gexp.scm3
-rw-r--r--guix/ui.scm3
2 files changed, 4 insertions, 2 deletions
diff --git a/guix/gexp.scm b/guix/gexp.scm
index 71041bcbad..8f9cb70d50 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -1455,7 +1455,8 @@ and in the current monad setting (system type, etc.)"
(($ <gexp-input> (? self-quoting? x))
(return x))
(($ <gexp-input> x)
- (raise (condition (&gexp-input-error (input x)))))
+ (raise (condition (&gexp-input-error (input x))
+ (&error-location (location (gexp-location exp))))))
(x
(return x)))))
diff --git a/guix/ui.scm b/guix/ui.scm
index f99a632b06..f5c6a1af10 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -808,7 +808,8 @@ evaluating the tests and bodies of CLAUSES."
target)))
((gexp-input-error? c)
(let ((input (gexp-error-invalid-input c)))
- (leave (G_ "~s: invalid G-expression input~%")
+ (leave (and (error-location? c) (error-location c))
+ (G_ "~s: invalid G-expression input~%")
(gexp-error-invalid-input c))))
((profile-not-found-error? c)
(leave (G_ "profile '~a' does not exist~%")