[GH-ISSUE #1154] add ProtoErrorKind::BufferNotEnough #615

Open
opened 2026-03-15 23:28:08 +03:00 by kerem · 1 comment
Owner

Originally created by @Sherlock-Holo on GitHub (Jun 27, 2020).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1154

Is your feature request related to a problem? Please describe.

I am trying to use trust_dns_proto BinDecodable to parse the DNS request from UDP, when the buffer is not enough, it return ProtoErrorKind::Msg with string "buffer exhausted". This is hard to check this error, If add a new ProtoErrorKind::BufferNotEnough to describe this error, it should be easier to handle this error.

Describe the solution you'd like

ProtoErrorKind add new value ProtoErrorKind::BufferNotEnough

Describe alternatives you've considered

check the string in ProtoErrorKind::Msg, like

if let ProtoErrorKind:Msg(err_str) = err_kind {
    if err_str == "buffer exhausted" {
        // handle error
    }
}


Originally created by @Sherlock-Holo on GitHub (Jun 27, 2020). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1154 **Is your feature request related to a problem? Please describe.** I am trying to use `trust_dns_proto` `BinDecodable` to parse the DNS request from UDP, when the buffer is not enough, it return `ProtoErrorKind::Msg` with string `"buffer exhausted"`. This is hard to check this error, If add a new `ProtoErrorKind::BufferNotEnough` to describe this error, it should be easier to handle this error. **Describe the solution you'd like** `ProtoErrorKind` add new value `ProtoErrorKind::BufferNotEnough` **Describe alternatives you've considered** check the string in `ProtoErrorKind::Msg`, like ```rust if let ProtoErrorKind:Msg(err_str) = err_kind { if err_str == "buffer exhausted" { // handle error } } ```
Author
Owner

@bluejekyll commented on GitHub (Jun 29, 2020):

Please, feel free to submit a PR for this if you have time.

<!-- gh-comment-id:651316125 --> @bluejekyll commented on GitHub (Jun 29, 2020): Please, feel free to submit a PR for this if you have time.
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#615
No description provided.