Skip to content
This repository was archived by the owner on Nov 25, 2025. It is now read-only.

Commit f1ee4ae

Browse files
committed
Make DNS-error-payload just contain a string.
Having `DNS-error-payload` record contain a string field for `rcode` while a `u16` field for `info-code` is surprising. If appplications will be expected to know the IANA values of the `u16` [INFO-CODE value], it would make sense for them to know the `u16` for the [RCODE value] too. But if they won't, then they likely don't have any use for either `u16` value, and just want a simple string. I think wasi-http could plausibly go either way: Provide `u16` values for both `rcode` and `info-code`, or neither, and instead just provide a `string`. In this PR, I propose to just provide a `string`. My guess is that most applications in scope here don't need precise DNS error code information and basically just need a way to report that "it was DNS". And, not all host resolver libraries provide error information that includes RCODE and INFO-CODE, for example [Rust's `ToSocketAddrs` trait] or [POSIX `getaddrinfo`]. Fixed #184. [RCODE value]: https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6 [INFO-CODE value]: https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#extended-dns-error-codes [Rust's `ToSocketAddrs` trait]: https://doc.rust-lang.org/stable/std/net/trait.ToSocketAddrs.html [POSIX `getaddrinfo`]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/freeaddrinfo.html
1 parent 14a19b3 commit f1ee4ae

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

wit-0.3.0-draft/types.wit

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ interface types {
7575

7676
/// Defines the case payload type for `DNS-error` above:
7777
record DNS-error-payload {
78-
rcode: option<string>,
79-
info-code: option<u16>
78+
/// An indication of the reason for the DNS error, if known.
79+
///
80+
/// This string is meant only for human consumption, and not for machine parsing.
81+
reason: option<string>,
8082
}
8183

8284
/// Defines the case payload type for `TLS-alert-received` above:

0 commit comments

Comments
 (0)