[PR #473] [CLOSED] Migrate proto from error-chain to failure #1463

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

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/473
Author: @silwol
Created: 5/18/2018
Status: Closed

Base: masterHead: dev/326


📝 Commits (1)

  • 3ca2b82 Migrate proto from error-chain to failure

📊 Changes

53 files changed (+1261 additions, -831 deletions)

View changed files

📝 client/Cargo.toml (+1 -1)
📝 client/src/client/client.rs (+3 -1)
📝 client/src/error/client_error.rs (+133 -64)
📝 client/src/error/dnssec_error.rs (+132 -45)
📝 client/src/error/lexer_error.rs (+101 -69)
📝 client/src/error/mod.rs (+6 -10)
📝 client/src/error/parse_error.rs (+175 -59)
📝 client/src/lib.rs (+1 -1)
📝 client/src/rr/dnssec/mod.rs (+1 -2)
📝 client/src/serialize/txt/master.rs (+2 -2)
📝 client/src/serialize/txt/master_lex.rs (+1 -1)
📝 integration-tests/src/authority.rs (+17 -8)
📝 integration-tests/tests/client_future_tests.rs (+2 -5)
📝 integration-tests/tests/client_tests.rs (+2 -6)
📝 proto/Cargo.toml (+1 -1)
📝 proto/src/error.rs (+272 -208)
📝 proto/src/lib.rs (+1 -1)
📝 proto/src/op/message.rs (+4 -21)
📝 proto/src/op/op_code.rs (+1 -1)
📝 proto/src/rr/dnssec/digest_type.rs (+3 -7)

...and 33 more files

📄 Description

Closes: #326

I finished the migration to failure. All tests pass on my Linux machines, but I have no other machines to test with.

My implementation tries to imitate what was available in the error-chain implementation as far as the available error kinds are affected. I did however throw some errors away that seemed to be no longer used, but were present in the error-chain implementation, either because they were needed in the past, or because they were copied over from one error implementation to another.

One significant difference is, that I added a Timeout error kind wherever appropriate, which gets mapped whenever possible (from std::io::Error to trust-dns error types, as well as from one trust-dns error type to another). From the user perspective, it seems to me that it make sense to always be able to easily check on the occurrence of timeouts.

I did implement the errors as heavy-weight as it seemed appropriate for the functionality, so maybe extra work needs to be done for #318 in a separate commit.

I stumbled upon one occurrence of a test affected by this change that has an #[ignore] flag attached, so I did my best to test what I would expect to work, but I couldn't test. This is in resolver/src/resolver_future.rs:519.

I hope my commit lives up to the expected format and quality, and would be happy about feedback if you find any problems with my changes, so I can update them accordingly. I would love to see this migration done in one of the upcoming releases.


🔄 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/473 **Author:** [@silwol](https://github.com/silwol) **Created:** 5/18/2018 **Status:** ❌ Closed **Base:** `master` ← **Head:** `dev/326` --- ### 📝 Commits (1) - [`3ca2b82`](https://github.com/hickory-dns/hickory-dns/commit/3ca2b82c7ff7edfa6eb759c61fca0763187369f8) Migrate proto from error-chain to failure ### 📊 Changes **53 files changed** (+1261 additions, -831 deletions) <details> <summary>View changed files</summary> 📝 `client/Cargo.toml` (+1 -1) 📝 `client/src/client/client.rs` (+3 -1) 📝 `client/src/error/client_error.rs` (+133 -64) 📝 `client/src/error/dnssec_error.rs` (+132 -45) 📝 `client/src/error/lexer_error.rs` (+101 -69) 📝 `client/src/error/mod.rs` (+6 -10) 📝 `client/src/error/parse_error.rs` (+175 -59) 📝 `client/src/lib.rs` (+1 -1) 📝 `client/src/rr/dnssec/mod.rs` (+1 -2) 📝 `client/src/serialize/txt/master.rs` (+2 -2) 📝 `client/src/serialize/txt/master_lex.rs` (+1 -1) 📝 `integration-tests/src/authority.rs` (+17 -8) 📝 `integration-tests/tests/client_future_tests.rs` (+2 -5) 📝 `integration-tests/tests/client_tests.rs` (+2 -6) 📝 `proto/Cargo.toml` (+1 -1) 📝 `proto/src/error.rs` (+272 -208) 📝 `proto/src/lib.rs` (+1 -1) 📝 `proto/src/op/message.rs` (+4 -21) 📝 `proto/src/op/op_code.rs` (+1 -1) 📝 `proto/src/rr/dnssec/digest_type.rs` (+3 -7) _...and 33 more files_ </details> ### 📄 Description Closes: #326 I finished the migration to failure. All tests pass on my Linux machines, but I have no other machines to test with. My implementation tries to imitate what was available in the error-chain implementation as far as the available error kinds are affected. I did however throw some errors away that seemed to be no longer used, but were present in the error-chain implementation, either because they were needed in the past, or because they were copied over from one error implementation to another. One significant difference is, that I added a `Timeout` error kind wherever appropriate, which gets mapped whenever possible (from `std::io::Error` to trust-dns error types, as well as from one trust-dns error type to another). From the user perspective, it seems to me that it make sense to always be able to easily check on the occurrence of timeouts. I did implement the errors as heavy-weight as it seemed appropriate for the functionality, so maybe extra work needs to be done for #318 in a separate commit. I stumbled upon one occurrence of a test affected by this change that has an `#[ignore]` flag attached, so I did my best to test what I would expect to work, but I couldn't test. This is in ` resolver/src/resolver_future.rs:519`. I hope my commit lives up to the expected format and quality, and would be happy about feedback if you find any problems with my changes, so I can update them accordingly. I would love to see this migration done in one of the upcoming releases. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 02:07: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#1463
No description provided.