Include an error code for each response#32
Merged
Dj-Codeman merged 1 commit intoDj-Codeman:masterfrom May 6, 2024
Merged
Conversation
Dj-Codeman
approved these changes
May 6, 2024
Owner
Dj-Codeman
left a comment
There was a problem hiding this comment.
Looks good! I'll write a few tests for the errors before the release but otherwise this is good.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates the output to include a new
errorfield for each item inresponses[].The field will be
nullif no error exists for that response.Closes #28
Formatted response when querying an existing domain with
cargo run -- --json dns.lookup.dog:{ "responses":[ { "queries":[ { "name":"dns.lookup.dog.", "class":"IN", "type":"A" } ], "answers":[ { "name":"dns.lookup.dog.", "class":"IN", "ttl":0, "type":"A", "data":{ "address":"51.159.146.31" } }, { "name":"dns.lookup.dog.", "class":"IN", "ttl":0, "type":"A", "data":{ "address":"51.159.149.163" } } ], "authorities":[], "additionals":[], "error":null } ] }Formatted response when querying a non-existent domain with
cargo run -- --json dns.lookup123.dog:{ "responses":[ { "queries":[ { "name":"dns.lookup123.dog.", "class":"IN", "type":"A" } ], "answers":[], "authorities":[ { "name":"dog.", "class":"IN", "ttl":1800, "type":"SOA", "data":{ "mname":"v0n0.nic.dog.", "rname":"hostmaster.donuts.email.", "serial":1714974458, "refresh_interval":7200, "retry_interval":900, "expire_limit":1209600, "minimum_ttl":3600 } } ], "additionals":[], "error":"NXDomain" } ] }