all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Rovanion Luckey <rovanion.luckey@gmail.com>
To: 46805@debbugs.gnu.org
Cc: Xinglu Chen <public@yoctocell.xyz>
Subject: [bug#46805] [PATCH] guix: ui: Improved error reporting when user file eval fails
Date: Wed, 24 Mar 2021 14:36:02 +0100	[thread overview]
Message-ID: <CAAaf0CANSABsZO2DsZmBiuuq52MBmWCk-xtLoTnGN8jauZe_ow@mail.gmail.com> (raw)
In-Reply-To: <87o8fadn50.fsf@yoctocell.xyz>


[-- Attachment #1.1: Type: text/plain, Size: 38 bytes --]

Fixed the typo in the attached patch.

[-- Attachment #1.2: Type: text/html, Size: 64 bytes --]

[-- Attachment #2: 0001-guix-ui-Improved-error-reporting-when-user-file-eval.patch --]
[-- Type: text/x-patch, Size: 1609 bytes --]

From 57126cbff38de728d64797551239723ed18575a5 Mon Sep 17 00:00:00 2001
From: Rovanion Luckey <rovanion.luckey@gmail.com>
Date: Fri, 26 Feb 2021 23:23:14 +0100
Subject: [PATCH] guix: ui: Improved error reporting when user file eval fails
 due to system errors

Added a specific error message for when the user provided scheme file being evaluated in turn fails to load another file. Also clarified the error message given on generic system errors, to make it clear where the error originates from.
---
 guix/ui.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

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.
-- 
2.30.0


  reply	other threads:[~2021-03-24 13:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-26 22:36 [bug#46805] [PATCH] guix: ui: Improved error reporting when user file eval fails Rovanion Luckey
2021-03-23 13:18 ` Xinglu Chen
2021-03-24 13:36   ` Rovanion Luckey [this message]
2021-10-12 18:14 ` Rovanion Luckey
2021-10-12 18:16 ` Rovanion Luckey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAaf0CANSABsZO2DsZmBiuuq52MBmWCk-xtLoTnGN8jauZe_ow@mail.gmail.com \
    --to=rovanion.luckey@gmail.com \
    --cc=46805@debbugs.gnu.org \
    --cc=public@yoctocell.xyz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.