From 4d59596a1c5f6b20870e619cbf67068ac7dd64ff Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 7 Nov 2021 15:56:19 +0100 Subject: ui: 'load*' correctly reports 'read-error' in all cases. Previously, 'read-error' exceptions other than "missing closing paren" would not be reported; instead, we'd directly call (exit 1) without printing anything. Fixes . Reported by Alice BRENON . * guix/ui.scm (report-load-error): Report the error without re-throwing upon 'read-error'. * tests/guix-build.sh: Add test. --- guix/ui.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'guix/ui.scm') diff --git a/guix/ui.scm b/guix/ui.scm index b01bb3d587..bd999103ff 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -377,7 +377,8 @@ ARGS is the list of arguments received by the 'throw' handler." (+ 2 (string-contains message ": "))))) (format (current-error-port) (G_ "~amissing closing parenthesis~%") location)) - (apply throw args))) + (report-error (G_ "read error while loading '~a': ~a~%") + file (apply format #f message args)))) (('syntax-error proc message properties form subform . rest) (let ((loc (source-properties->location properties))) (report-error loc (G_ "~s: ~a~%") -- cgit v1.2.3