[PR #2530] [MERGED] Make error modules private #3110

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

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/2530
Author: @djc
Created: 10/24/2024
Status: Merged
Merged: 10/30/2024
Merged by: @djc

Base: mainHead: error-api


📝 Commits (6)

  • 2cc0a4b proto: remove unused trait
  • 11c909d proto: make error module private
  • 7313e54 resolver: make error module private
  • a0ccde5 client: make error module private
  • 0d332e8 recursor: make error module private
  • 6bad6a2 server: make error module private

📊 Changes

57 files changed (+188 additions, -223 deletions)

View changed files

📝 bin/benches/comparison_benches.rs (+2 -2)
📝 bin/src/lib.rs (+5 -5)
📝 bin/tests/integration/named_https_tests.rs (+1 -1)
📝 bin/tests/integration/named_quic_tests.rs (+1 -1)
📝 bin/tests/integration/server_harness/mod.rs (+3 -1)
📝 bin/tests/integration/server_harness/mut_message_client.rs (+1 -1)
📝 crates/async-std-resolver/src/lib.rs (+1 -1)
📝 crates/async-std-resolver/src/runtime.rs (+4 -4)
📝 crates/client/src/client/client.rs (+5 -5)
📝 crates/client/src/client/dnssec_client.rs (+1 -1)
📝 crates/client/src/client/memoize_client_handle.rs (+2 -2)
📝 crates/client/src/client/rc_stream.rs (+1 -1)
📝 crates/client/src/error.rs (+6 -4)
crates/client/src/error/mod.rs (+0 -24)
📝 crates/client/src/lib.rs (+2 -1)
📝 crates/proto/src/error.rs (+21 -11)
📝 crates/proto/src/lib.rs (+5 -2)
📝 crates/recursor/src/error.rs (+3 -13)
📝 crates/recursor/src/lib.rs (+1 -1)
📝 crates/recursor/src/recursor.rs (+8 -11)

...and 37 more files

📄 Description

The error types are a fairly important part of the public API, so IMO documentation is better if these types are not "hidden" in an error module but instead visible at the top level.

Similarly, the use of Result aliases IMO does not provide much value and does have some costs (an extra indirection level in the documentation being one obvious cost). Keep them private.


🔄 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/2530 **Author:** [@djc](https://github.com/djc) **Created:** 10/24/2024 **Status:** ✅ Merged **Merged:** 10/30/2024 **Merged by:** [@djc](https://github.com/djc) **Base:** `main` ← **Head:** `error-api` --- ### 📝 Commits (6) - [`2cc0a4b`](https://github.com/hickory-dns/hickory-dns/commit/2cc0a4b0a3de8c6b4cdc077a54c3fce56ce0fbba) proto: remove unused trait - [`11c909d`](https://github.com/hickory-dns/hickory-dns/commit/11c909dd0aeb14a5199dcc8f64d15beedc1afc95) proto: make error module private - [`7313e54`](https://github.com/hickory-dns/hickory-dns/commit/7313e543014c878224a5456c0a8c98e91954558b) resolver: make error module private - [`a0ccde5`](https://github.com/hickory-dns/hickory-dns/commit/a0ccde54916ed7a1b7f7fc84220c5f2aab17a662) client: make error module private - [`0d332e8`](https://github.com/hickory-dns/hickory-dns/commit/0d332e81e1c60d4a389266bd4d025372f54ba4ae) recursor: make error module private - [`6bad6a2`](https://github.com/hickory-dns/hickory-dns/commit/6bad6a2001fdda8048e864fbfc2b355358a0d059) server: make error module private ### 📊 Changes **57 files changed** (+188 additions, -223 deletions) <details> <summary>View changed files</summary> 📝 `bin/benches/comparison_benches.rs` (+2 -2) 📝 `bin/src/lib.rs` (+5 -5) 📝 `bin/tests/integration/named_https_tests.rs` (+1 -1) 📝 `bin/tests/integration/named_quic_tests.rs` (+1 -1) 📝 `bin/tests/integration/server_harness/mod.rs` (+3 -1) 📝 `bin/tests/integration/server_harness/mut_message_client.rs` (+1 -1) 📝 `crates/async-std-resolver/src/lib.rs` (+1 -1) 📝 `crates/async-std-resolver/src/runtime.rs` (+4 -4) 📝 `crates/client/src/client/client.rs` (+5 -5) 📝 `crates/client/src/client/dnssec_client.rs` (+1 -1) 📝 `crates/client/src/client/memoize_client_handle.rs` (+2 -2) 📝 `crates/client/src/client/rc_stream.rs` (+1 -1) 📝 `crates/client/src/error.rs` (+6 -4) ➖ `crates/client/src/error/mod.rs` (+0 -24) 📝 `crates/client/src/lib.rs` (+2 -1) 📝 `crates/proto/src/error.rs` (+21 -11) 📝 `crates/proto/src/lib.rs` (+5 -2) 📝 `crates/recursor/src/error.rs` (+3 -13) 📝 `crates/recursor/src/lib.rs` (+1 -1) 📝 `crates/recursor/src/recursor.rs` (+8 -11) _...and 37 more files_ </details> ### 📄 Description The error types are a fairly important part of the public API, so IMO documentation is better if these types are not "hidden" in an `error` module but instead visible at the top level. Similarly, the use of `Result` aliases IMO does not provide much value and does have some costs (an extra indirection level in the documentation being one obvious cost). Keep them private. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 11:25:50 +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#3110
No description provided.