[PR #3251] [MERGED] proto: clean up ProtoError #3684

Closed
opened 2026-03-16 11:56:57 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/3251
Author: @djc
Created: 9/3/2025
Status: Merged
Merged: 9/4/2025
Merged by: @djc

Base: mainHead: dns-error


📝 Commits (10+)

  • 8bc0189 proto: extract DnsError from ProtoError
  • 4317ff5 Move ProtoErrorKind::BadQueryCount to LookupError
  • 582ec8d proto: remove unused ProtoErrorKind::Canceled
  • 8e89f85 proto: avoid duplicating DecodeError variants
  • 69b001d proto: move DnsKeyProtocolNot3 into DecodeError
  • 3cfd675 proto: move EdnsNameNotRoot into DecodeError
  • 4458d3a proto: move IncorrectRDataLengthRead into DecodeError
  • b963376 Move ProtoErrorKind::MaxRecordLimitExceeded into recursor::Error
  • 2b7bc83 proto: move UnknownAlgorithmTypeValue into DecodeError
  • e99b734 proto: move UnknownDigestTypeValue into DecodeError

📊 Changes

59 files changed (+742 additions, -882 deletions)

View changed files

📝 bin/benches/comparison_benches.rs (+5 -9)
📝 bin/src/lib.rs (+4 -6)
📝 crates/client/src/client/client.rs (+8 -11)
📝 crates/client/src/client/dnssec_client.rs (+9 -12)
📝 crates/proto/src/dnssec/crypto.rs (+16 -10)
📝 crates/proto/src/dnssec/handle.rs (+6 -6)
📝 crates/proto/src/dnssec/nsec3.rs (+16 -12)
📝 crates/proto/src/dnssec/rdata/cdnskey.rs (+5 -3)
📝 crates/proto/src/dnssec/rdata/dnskey.rs (+5 -4)
📝 crates/proto/src/dnssec/rdata/nsec3.rs (+3 -3)
📝 crates/proto/src/dnssec/rdata/nsec3param.rs (+4 -4)
📝 crates/proto/src/error.rs (+229 -539)
📝 crates/proto/src/h2/h2_client_stream.rs (+16 -12)
📝 crates/proto/src/h3/h3_client_stream.rs (+12 -6)
📝 crates/proto/src/lib.rs (+1 -1)
📝 crates/proto/src/quic/quic_client_stream.rs (+11 -6)
📝 crates/proto/src/rr/dns_class.rs (+8 -5)
📝 crates/proto/src/rr/domain/label.rs (+5 -4)
📝 crates/proto/src/rr/domain/name.rs (+11 -11)
📝 crates/proto/src/rr/rdata/csync.rs (+1 -1)

...and 39 more files

📄 Description

An attempt to clean up the pile of stuff in ProtoError/ProtoErrorKind, in preparation for

I think being more intentional about our error types will improve correctness (as seen in the first commit, where some dubious code in the resolver becomes more correct).

I moved a bunch of stuff into DecodeError and later noticed we also have ParseError. I think some of the variants I moved into DecodeError might actually belong in ParseError but that seems lower priority since it doesn't affect the proto crate split.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hickory-dns/hickory-dns/pull/3251 **Author:** [@djc](https://github.com/djc) **Created:** 9/3/2025 **Status:** ✅ Merged **Merged:** 9/4/2025 **Merged by:** [@djc](https://github.com/djc) **Base:** `main` ← **Head:** `dns-error` --- ### 📝 Commits (10+) - [`8bc0189`](https://github.com/hickory-dns/hickory-dns/commit/8bc018936008d7eab7bc7779b08c84278827b48c) proto: extract DnsError from ProtoError - [`4317ff5`](https://github.com/hickory-dns/hickory-dns/commit/4317ff5071f98a8e533691127ab6a9b7b9574b1e) Move ProtoErrorKind::BadQueryCount to LookupError - [`582ec8d`](https://github.com/hickory-dns/hickory-dns/commit/582ec8de43f14ea50d2f933362c2cfeba6913b9a) proto: remove unused ProtoErrorKind::Canceled - [`8e89f85`](https://github.com/hickory-dns/hickory-dns/commit/8e89f85f25bd718a8f09ec9069002987607ef0e2) proto: avoid duplicating DecodeError variants - [`69b001d`](https://github.com/hickory-dns/hickory-dns/commit/69b001d1df3127b60517ecb73c34046ecf063145) proto: move DnsKeyProtocolNot3 into DecodeError - [`3cfd675`](https://github.com/hickory-dns/hickory-dns/commit/3cfd675784743a720d9caa7b9e2430ec9a1f8671) proto: move EdnsNameNotRoot into DecodeError - [`4458d3a`](https://github.com/hickory-dns/hickory-dns/commit/4458d3aa01e341c161b9297c83395fea46349f02) proto: move IncorrectRDataLengthRead into DecodeError - [`b963376`](https://github.com/hickory-dns/hickory-dns/commit/b963376c32cde4eb819757ba94a7bdad886e4e54) Move ProtoErrorKind::MaxRecordLimitExceeded into recursor::Error - [`2b7bc83`](https://github.com/hickory-dns/hickory-dns/commit/2b7bc839d35aeedaf1b93fc5b2989fa91ae7b9bb) proto: move UnknownAlgorithmTypeValue into DecodeError - [`e99b734`](https://github.com/hickory-dns/hickory-dns/commit/e99b734b08358ce2b1d799359c3f99a349c7fc9e) proto: move UnknownDigestTypeValue into DecodeError ### 📊 Changes **59 files changed** (+742 additions, -882 deletions) <details> <summary>View changed files</summary> 📝 `bin/benches/comparison_benches.rs` (+5 -9) 📝 `bin/src/lib.rs` (+4 -6) 📝 `crates/client/src/client/client.rs` (+8 -11) 📝 `crates/client/src/client/dnssec_client.rs` (+9 -12) 📝 `crates/proto/src/dnssec/crypto.rs` (+16 -10) 📝 `crates/proto/src/dnssec/handle.rs` (+6 -6) 📝 `crates/proto/src/dnssec/nsec3.rs` (+16 -12) 📝 `crates/proto/src/dnssec/rdata/cdnskey.rs` (+5 -3) 📝 `crates/proto/src/dnssec/rdata/dnskey.rs` (+5 -4) 📝 `crates/proto/src/dnssec/rdata/nsec3.rs` (+3 -3) 📝 `crates/proto/src/dnssec/rdata/nsec3param.rs` (+4 -4) 📝 `crates/proto/src/error.rs` (+229 -539) 📝 `crates/proto/src/h2/h2_client_stream.rs` (+16 -12) 📝 `crates/proto/src/h3/h3_client_stream.rs` (+12 -6) 📝 `crates/proto/src/lib.rs` (+1 -1) 📝 `crates/proto/src/quic/quic_client_stream.rs` (+11 -6) 📝 `crates/proto/src/rr/dns_class.rs` (+8 -5) 📝 `crates/proto/src/rr/domain/label.rs` (+5 -4) 📝 `crates/proto/src/rr/domain/name.rs` (+11 -11) 📝 `crates/proto/src/rr/rdata/csync.rs` (+1 -1) _...and 39 more files_ </details> ### 📄 Description An attempt to clean up the pile of stuff in `ProtoError`/`ProtoErrorKind`, in preparation for - #3221 I think being more intentional about our error types will improve correctness (as seen in the first commit, where some dubious code in the resolver becomes more correct). I moved a bunch of stuff into `DecodeError` and later noticed we also have `ParseError`. I think some of the variants I moved into `DecodeError` might actually belong in `ParseError` but that seems lower priority since it doesn't affect the proto crate split. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 11:56:57 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#3684
No description provided.