From patchwork Fri Feb 26 22:36:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rovanion Luckey X-Patchwork-Id: 27320 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A710727BD42; Fri, 26 Feb 2021 22:38:09 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id CE60527BD43 for ; Fri, 26 Feb 2021 22:38:08 +0000 (GMT) Received: from localhost ([::1]:37886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lFlkN-00086A-Ur for patchwork@mira.cbaines.net; Fri, 26 Feb 2021 17:38:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lFlkI-00085q-8c for guix-patches@gnu.org; Fri, 26 Feb 2021 17:38:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:59420) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lFlkI-00038H-1D for guix-patches@gnu.org; Fri, 26 Feb 2021 17:38:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lFlkH-0008Iw-Se for guix-patches@gnu.org; Fri, 26 Feb 2021 17:38:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#46805] [PATCH] guix: ui: Improved error reporting when user file eval fails Resent-From: Rovanion Luckey Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 26 Feb 2021 22:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46805 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 46805@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.161437904331867 (code B ref -1); Fri, 26 Feb 2021 22:38:01 +0000 Received: (at submit) by debbugs.gnu.org; 26 Feb 2021 22:37:23 +0000 Received: from localhost ([127.0.0.1]:42733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFljf-0008Ht-7e for submit@debbugs.gnu.org; Fri, 26 Feb 2021 17:37:23 -0500 Received: from lists.gnu.org ([209.51.188.17]:39498) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFljd-0008Hm-RJ for submit@debbugs.gnu.org; Fri, 26 Feb 2021 17:37:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lFljc-00082y-8j for guix-patches@gnu.org; Fri, 26 Feb 2021 17:37:21 -0500 Received: from mail-io1-xd32.google.com ([2607:f8b0:4864:20::d32]:33427) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lFljY-0002oJ-0J for guix-patches@gnu.org; Fri, 26 Feb 2021 17:37:19 -0500 Received: by mail-io1-xd32.google.com with SMTP id e2so8023906iog.0 for ; Fri, 26 Feb 2021 14:37:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=uuCmdpx7sKJShiecAEyt8WCqA7qxWTfqZgJjlpXwf8o=; b=Edm0fkov5DBKViYX/GZC12WJaHKgwJbej0/AB99aaT2/EnLPswyN8hm1yWuij7HwCB ePotAzsH8BZADn/afzFymwHZ7JvVtqLGfFu+8+RsIHz3yQXUJshWJdJUEAi3Sufev0Fb v83uCR8/BosI8MQayQ3kGulyOdZ5XgkhKoZISa9DyUtwjHMxydMxMa+gMu7MS8c6h441 174gF0ghKxvvssCJKdN0I/xfqdy3Vqvp2kIGXf84oxv+aANMjL6zSgZg5cmIL7Q3wY8E 5LL3r5IPNWmetosph95N7xHMEm9SoHzF0F2gQvMhPyiem4/o7aJxmjwqM1ssd4Xh3NVy 1wKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=uuCmdpx7sKJShiecAEyt8WCqA7qxWTfqZgJjlpXwf8o=; b=QhJbtFUjcNSimwqg/RRIAdrFzlwoEiyDxlvxBlAZ8kzzdx120TDZAwTZqhIYlrGSx8 /lW7mv6lQ2WYngxlk+VErubBJ3iToAhaRAmz6g5mLBrlkcWzzbQxPwoJxq12cyKVT/DV 4eMQgLx2ATQf2P06r0hixvyE7KHtqHRJLJmn+tqgYmWqphNs9G2QESULuQgPzJQfAS6N wR9CBbHoOWCeDRgy8WnEhoVOL/jiMzTBxUWLDs4rRuWWYGGxnMflft6L1v+Uu6hdNkZO K00Rmm8ZxNnxoOJnum9H0u0xqck9VBLFWpAnO3wPn6gKhpxDpg8SgFAgAWmzD9hY9RLL dYlQ== X-Gm-Message-State: AOAM530kpkhxa80inh3bWda1xuCztirwIseXHaLPTUH/qtlH+L/MJP78 LkhJ6Jlz7cUWAglo1+wlTZ5MVUShJ0wMgwKY0A0F5GRrgXc= X-Google-Smtp-Source: ABdhPJxmn+6UUE3hu710685ozDz1UaOvUFS+PyXxeZlvEX/4nG6k0sFf/OXkwoUlkcVm3xyEX5Jk2iM1oXokeyYL7ew= X-Received: by 2002:a6b:d01a:: with SMTP id x26mr4612016ioa.11.1614379032262; Fri, 26 Feb 2021 14:37:12 -0800 (PST) MIME-Version: 1.0 From: Rovanion Luckey Date: Fri, 26 Feb 2021 23:36:46 +0100 Message-ID: Received-SPF: pass client-ip=2607:f8b0:4864:20::d32; envelope-from=rovanion.luckey@gmail.com; helo=mail-io1-xd32.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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. See attached patch. From 57126cbff38de728d64797551239723ed18575a5 Mon Sep 17 00:00:00 2001 From: Rovanion Luckey 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 clearified 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