[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#63516: [PATCH Guile-Netlink 09/11] error: Add 'sub-type' field to '&
From: |
Ludovic Courtès |
Subject: |
bug#63516: [PATCH Guile-Netlink 09/11] error: Add 'sub-type' field to '&netlink-decoder-error' and use it. |
Date: |
Tue, 23 May 2023 14:39:49 +0200 |
* netlink/error.scm (&netlink-decoder-error)[sub-type]: New field.
* netlink/data.scm (get-next-deserialize, get-current-deserialize): Fill
it out.
---
netlink/data.scm | 13 +++++++++----
netlink/error.scm | 4 +++-
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/netlink/data.scm b/netlink/data.scm
index c9b5fb8..ac95051 100644
--- a/netlink/data.scm
+++ b/netlink/data.scm
@@ -51,15 +51,20 @@
(match (assoc-ref decoder current-type)
((_ . type-alist)
(or (assoc-ref type-alist target-type)
- (assoc-ref type-alist 'default)))
+ (assoc-ref type-alist 'default)
+ (raise (condition (&netlink-decoder-error
+ (type current-type)
+ (sub-type target-type))))))
(#f (raise (condition (&netlink-decoder-error
- (type current-type)))))))
-
+ (type current-type)
+ (sub-type target-type)))))))
+
(define (get-current-deserialize decoder current-type)
(match (assoc-ref decoder current-type)
((current-deserialize . _) current-deserialize)
(#f (raise (condition (&netlink-decoder-error
- (type current-type)))))))
+ (type current-type)
+ (sub-type #f)))))))
(define (deserialize type decoder bv pos)
(let ((deserialize (get-current-deserialize decoder type)))
diff --git a/netlink/error.scm b/netlink/error.scm
index 3e101ed..fa1dba6 100644
--- a/netlink/error.scm
+++ b/netlink/error.scm
@@ -23,6 +23,7 @@
&netlink-decoder-error
netlink-decoder-error?
netlink-decoder-error-type
+ netlink-decoder-error-sub-type
&netlink-family-error
netlink-family-error?
@@ -57,7 +58,8 @@
;; No decoder for type
(define-condition-type &netlink-decoder-error &netlink-error
netlink-decoder-error?
- (type netlink-decoder-error-type))
+ (type netlink-decoder-error-type)
+ (sub-type netlink-decoder-error-sub-type))
;; Unknown protocol family
(define-condition-type &netlink-family-error &netlink-error
--
2.40.1
- bug#63516: Static networking should wait for interfaces to be up, Ludovic Courtès, 2023/05/15
- bug#63516: Static networking should wait for interfaces to be up, Ludovic Courtès, 2023/05/20
- bug#63516: [PATCH Guile-Netlink 00/11] Add 'wait-for-link' and related code, Ludovic Courtès, 2023/05/23
- bug#63516: [PATCH Guile-Netlink 07/11] addr: Extract 'new-address-message->address'., Ludovic Courtès, 2023/05/23
- bug#63516: [PATCH Guile-Netlink 04/11] connection: Add support for suspendable sockets., Ludovic Courtès, 2023/05/23
- bug#63516: [PATCH Guile-Netlink 02/11] connection: Use Guile's 'socket' procedure to open a socket., Ludovic Courtès, 2023/05/23
- bug#63516: [PATCH Guile-Netlink 01/11] connection: Remove unused procedure., Ludovic Courtès, 2023/05/23
- bug#63516: [PATCH Guile-Netlink 03/11] connection: Throw upon errors in FFI bindings., Ludovic Courtès, 2023/05/23
- bug#63516: [PATCH Guile-Netlink 08/11] connection: Add 'add-socket-membership'., Ludovic Courtès, 2023/05/23
- bug#63516: [PATCH Guile-Netlink 10/11] doc: Add indexes., Ludovic Courtès, 2023/05/23
- bug#63516: [PATCH Guile-Netlink 09/11] error: Add 'sub-type' field to '&netlink-decoder-error' and use it.,
Ludovic Courtès <=
- bug#63516: [PATCH Guile-Netlink 11/11] link: Add 'wait-for-link'., Ludovic Courtès, 2023/05/23
- bug#63516: [PATCH Guile-Netlink 06/11] link: Extract 'new-link-message->link'., Ludovic Courtès, 2023/05/23
- bug#63516: [PATCH Guile-Netlink 05/11] connection: Allow users to pass extra SOCK_ flags to 'socket'., Ludovic Courtès, 2023/05/23
- bug#63516: [PATCH Guile-Netlink 00/11] Add 'wait-for-link' and related code, Julien Lepiller, 2023/05/23
- bug#63516: [PATCH Guile-Netlink 00/11] Add 'wait-for-link' and related code, Ludovic Courtès, 2023/05/24
- bug#63516: [PATCH Guile-Netlink 00/11] Add 'wait-for-link' and related code, Julien Lepiller, 2023/05/24