guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#49671] [PATCH] guix: records: Improve error reporting.


From: Julien Lepiller
Subject: [bug#49671] [PATCH] guix: records: Improve error reporting.
Date: Sun, 31 Oct 2021 03:06:35 +0100

Hi Guix!

Here is a new patch that attempts to better catch various causes of
syntax errors in records. I think I fixed all the concerns Ludo had,
and I draw some inspiration from https://issues.guix.gnu.org/50914 for
using conditions.

Here are examples of what you get:

(operating-system
  ())

test.scm:1:0: error: invalid field specifier: ()
hint: The format of a field is `(field value)'



(operating-system
  ((services %base-services)))

test.scm:1:0: error: invalid field specifier: (services %base-services)
is not a valid field name



(operating-system
  (services))

test.scm:1:0: error: missing value in field specifier
hint: The field is missing a value: `(services <value>)'.



(operating-system
  (services (service tor-service-type) %base-services))

test.scm:1:0: error: multiple values in field specifier
hint: 2 values were associated with field `services'.  We got the
following values:

     (service tor-service-type)
     %base-services
     

Perhaps the additional values were intended to be other field
specifiers.  This usually indicates missing or misplaced parenthesis.



(operating-system
  services %base-services)

test.scm:1:0: error: invalid field specifier: #<syntax services>
hint: The format of a field is `(field value)'



(not sure why the last one is wrapped in syntax...)

Attachment: 0001-guix-records-Improve-error-reporting.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]