summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRovanion Luckey <rovanion.luckey@gmail.com>2021-02-26 23:23:14 +0100
committerGuix Patches Tester <>2021-02-26 22:39:23 +0000
commit411efd63a5c88de0bc89dc625311f0ee45e0b095 (patch)
treea1bcc5e953ed58a1377ed8726b8e6cc493d5695f
parent68a9e933c7e319085541ba8e8e0e932ade36d8a4 (diff)
downloadguix-patches-411efd63a5c88de0bc89dc625311f0ee45e0b095.tar
guix-patches-411efd63a5c88de0bc89dc625311f0ee45e0b095.tar.gz
guix: ui: Improved error reporting when user file eval fails due to system errorsseries-7145
Added a specific error message for when the user provided scheme file being evaluated in turn fails to load another file. Also clearified the error message given on generic system errors, to make it clear where the error originates from.
-rw-r--r--guix/ui.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/guix/ui.scm b/guix/ui.scm
index 7fbd4c63a2..0eabf136f6 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -373,9 +373,14 @@ it doesn't."
"Report the failure to load FILE, a user-provided Scheme file.
ARGS is the list of arguments received by the 'throw' handler."
(match args
+ (('system-error "open-file" . rest)
+ (let ((err (system-error-errno args))
+ (file-which-failed-to-open (car (cdr (car (cdr rest))))))
+ (report-error (G_ "while evaluating '~a', it failed opening '~a' with the error: ~a~%")
+ file file-which-failed-to-open (strerror err))))
(('system-error . rest)
(let ((err (system-error-errno args)))
- (report-error (G_ "failed to load '~a': ~a~%") file (strerror err))))
+ (report-error (G_ "failed to evaluate '~a', it raised the error: ~a~%") file (strerror err))))
(('read-error "scm_i_lreadparen" message _ ...)
;; Guile's missing-paren messages are obscure so we make them more
;; intelligible here.