mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-05-27 19:41:50 +02:00
services: static-networking: Tweak error messages.
* gnu/services/base.scm (assert-network-link-mac-address): Change error message string to conform to standards. (assert-network-link-type): Change to ‘define-with-syntax-properties’ since previously it would reject a non-literal symbol. Adjust message string. Change-Id: I0a8b9d7512ca7567f9d60eb15ad6fb4e05020e48 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
@@ -3189,21 +3189,21 @@ Write, say, @samp{\"~a/24\"} for a 24-bit network mask.")
|
|||||||
((and (string? value) (mac-address? value)) value)
|
((and (string? value) (mac-address? value)) value)
|
||||||
(else (raise
|
(else (raise
|
||||||
(make-compound-condition
|
(make-compound-condition
|
||||||
(formatted-message (G_ "Value (~S) is not a valid mac address.~%")
|
(formatted-message (G_ "~s: invalid MAC address")
|
||||||
value)
|
value)
|
||||||
(condition (&error-location
|
(condition (&error-location
|
||||||
(location (source-properties->location procedure-call-location)))))))))
|
(location (source-properties->location procedure-call-location)))))))))
|
||||||
|
|
||||||
(define-compile-time-procedure (assert-network-link-type (value identity))
|
(define-with-syntax-properties (assert-network-link-type (value properties))
|
||||||
(match value
|
(match value
|
||||||
(#f value)
|
(#f value)
|
||||||
(('quote _) (datum->syntax #'value value))
|
((? symbol?) value)
|
||||||
(else
|
(_
|
||||||
(raise
|
(raise
|
||||||
(make-compound-condition
|
(make-compound-condition
|
||||||
(formatted-message (G_ "Value (~S) is not a symbol.~%") value)
|
(formatted-message (G_ "~s: invalid link type") value)
|
||||||
(condition (&error-location
|
(condition (&error-location
|
||||||
(location (source-properties->location procedure-call-location)))))))))
|
(location (source-properties->location properties)))))))))
|
||||||
|
|
||||||
(define-record-type* <static-networking>
|
(define-record-type* <static-networking>
|
||||||
static-networking make-static-networking
|
static-networking make-static-networking
|
||||||
|
|||||||
Reference in New Issue
Block a user