summary refs log tree commit diff
path: root/gnu/services/mail.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-06-18 22:37:20 +0200
committerLudovic Courtès <ludo@gnu.org>2022-06-24 23:18:20 +0200
commitfb7e6ccba7cc243cd96cdc3fde3daa9a5f08e531 (patch)
tree2818996e5527553d52cdabd431dd245acc33a8da /gnu/services/mail.scm
parent43137d058fe575a70707073bede3465b4c5f555a (diff)
downloadguix-fb7e6ccba7cc243cd96cdc3fde3daa9a5f08e531.tar.gz
services: configuration: Report the location of field type errors.
Previously field type errors would be reported in a non-standard way,
and without any source location information.  This fixes it.

* gnu/services/configuration.scm (configuration-field-error): Add a
'loc' parameter and honor it.  Use 'formatted-message' instead of plain
'format'.
(define-configuration-helper)[field-sanitizer]: New procedure.
Use it.  Use STEM as the identifier of the syntactic constructor of the
record type.  Add a 'sanitize' property to each field.  Remove now
useless STEM macro that would call 'validate-configuration'.
* gnu/services/mail.scm (serialize-listener-configuration): Adjust to
new 'configuration-field-error' prototype.
* tests/services/configuration.scm ("wrong type for a field"): New test.
* po/guix/POTFILES.in: Add gnu/services/configuration.scm.
Diffstat (limited to 'gnu/services/mail.scm')
-rw-r--r--gnu/services/mail.scm2
1 files changed, 1 insertions, 1 deletions
diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index d99743ac31..c2fd4d8670 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -285,7 +285,7 @@ the section name.")
     (serialize-fifo-listener-configuration field-name val))
    ((inet-listener-configuration? val)
     (serialize-inet-listener-configuration field-name val))
-   (else (configuration-field-error field-name val))))
+   (else (configuration-field-error #f field-name val))))
 (define (listener-configuration-list? val)
   (and (list? val) (and-map listener-configuration? val)))
 (define (serialize-listener-configuration-list field-name val)