Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ext/net): relevant errors for resolveDns #12370

Merged
merged 3 commits into from Oct 10, 2021

Conversation

satyarohith
Copy link
Member

This PR maps resolveDns errors to Deno errors where applicable.

DNS protocol errors are still returned as generic errors. I'm
not sure if we should create a new DNSError class for them.

Closes #9197

@satyarohith satyarohith requested a review from kt3k October 8, 2021 06:37
@kt3k
Copy link
Member

kt3k commented Oct 8, 2021

Is it possible to write test cases which exercise some of these code paths?

@lucacasonato
Copy link
Member

DNS protocol errors are still returned as generic errors. I'm
not sure if we should create a new DNSError class for them.

I think a Deno.errors.Dns might be useful indeed.

@satyarohith
Copy link
Member Author

Is it possible to write test cases which exercise some of these code paths?

Updated an existing test for NotFound. It might be complicated to exercise NotConnected and TimedOut

@satyarohith
Copy link
Member Author

DNS protocol errors are still returned as generic errors. I'm
not sure if we should create a new DNSError class for them.

I think a Deno.errors.Dns might be useful indeed.

I'm open but also a little hesitant as it feels like the protocol errors are very uncommon.

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as this is definitely better than the current state, but I think we can do more work about this

cc @magurotuna Do you have any opinion about this?

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@satyarohith
Copy link
Member Author

@magurotuna, I'm merging this PR for the time being. Would you mind letting me know if you have any thoughts on this change? I'll make a PR if you suggest any changes.

@satyarohith satyarohith merged commit 25771b3 into denoland:main Oct 10, 2021
@satyarohith satyarohith deleted the resolve_dns_error_kinds branch October 10, 2021 10:14
bartlomieju pushed a commit to bartlomieju/deno that referenced this pull request Oct 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deno.resolveDns should return more useful error info
4 participants